diff --git a/android/app/build.gradle b/android/app/build.gradle index 720330da..5d196986 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,19 +41,28 @@ 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 - + } buildTypes { + debug {} release { // TODO: Add your own signing config for the release build. // Signing with the debug keys for now, so `flutter run --release` works. signingConfig signingConfigs.debug } + staging { + // Specifies a sorted list of fallback build types that the + // plugin should try to use when a dependency does not include a + // "staging" build type. You may specify as many fallbacks as you + // like, and the plugin selects the first build type that's + // available in the dependency. + matchingFallbacks = ['debug', 'qa', 'release'] + } } } @@ -63,9 +72,15 @@ flutter { dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - implementation "com.google.firebase:firebase-messaging:20.1.0" - implementation 'pub.devrel:easypermissions:0.4.0' - implementation 'com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava' - - + implementation "com.google.firebase:firebase-messaging:20.3.0" + implementation 'pub.devrel:easypermissions:0.4.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']) + + // Dependency on a remote binary +// implementation 'com.example.android:app-magic:12.3' + + } diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 065f9f47..2e2b8115 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -74,8 +74,8 @@ android:name="flutterEmbedding" android:value="2" /> - - + diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/MainActivity.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/MainActivity.kt index 35ce314d..b8a87c8c 100644 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/MainActivity.kt +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/MainActivity.kt @@ -1,36 +1,11 @@ package com.cloud.diplomaticquarterapp -import android.content.ContentResolver -import android.content.Context -import android.media.RingtoneManager -import io.flutter.embedding.android.FlutterActivity -import io.flutter.embedding.engine.FlutterEngine -import io.flutter.plugin.common.MethodCall -import io.flutter.plugin.common.MethodChannel -import io.flutter.plugins.GeneratedPluginRegistrant +import androidx.annotation.NonNull; + import io.flutter.embedding.android.FlutterFragmentActivity + import io.flutter.embedding.engine.FlutterEngine + import io.flutter.plugins.GeneratedPluginRegistrant -class MainActivity : FlutterActivity() { - override fun configureFlutterEngine(flutterEngine: FlutterEngine) { - GeneratedPluginRegistrant.registerWith(flutterEngine) - MethodChannel(flutterEngine.dartExecutor, "crossingthestreams.io/resourceResolver").setMethodCallHandler { call: MethodCall, result: MethodChannel.Result -> - if ("drawableToUri" == call.method) { - val resourceId = this@MainActivity.resources.getIdentifier(call.arguments as String, "drawable", this@MainActivity.packageName) - result.success(resourceToUriString(this@MainActivity.applicationContext, resourceId)) - } - if ("getAlarmUri" == call.method) { - result.success(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_ALARM).toString()) - } - } - } - - companion object { - private fun resourceToUriString(context: Context, resId: Int): String { - return (ContentResolver.SCHEME_ANDROID_RESOURCE - + "://" - + context.resources.getResourcePackageName(resId) - + "/" - + context.resources.getResourceTypeName(resId) - + "/" - + context.resources.getResourceEntryName(resId)) - } - } +class MainActivity: FlutterFragmentActivity() { + override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) { + GeneratedPluginRegistrant.registerWith(flutterEngine); + } } \ No newline at end of file diff --git a/assets/app_icons/config.json b/assets/app_icons/config.json index 4c7eefa6..e0f1051d 100644 --- a/assets/app_icons/config.json +++ b/assets/app_icons/config.json @@ -131,6 +131,174 @@ "search": [ "parking_icon" ] + }, + { + "uid": "03df3404af4fa2db99c8dfb9e9729367", + "css": "more_menu_icon", + "code": 59401, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "", + "width": 222 + }, + "search": [ + "more_menu_icon" + ] + }, + { + "uid": "8882d4d64a842809f1cb078522c9b867", + "css": "offer_icon", + "code": 59402, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M1089.5 567L1107.2 972.1 1406.5 924.4 1467.7 530ZM1089.5 567L1107.2 972.1 934 924.4 873.6 530ZM856.1 506L865 588.4 1083.3 622.8 1080.4 541.3ZM1495.6 506L1482 588.4 1083.3 622.8 1080.4 541.3ZM856.1 506L1080.4 541.3 1495.5 506 1221.9 481.9ZM994.9 527.4L1351 493.3 1288 487.7 934 518.2ZM1336 519.5L1100 489.9 1059 492.6 1272.6 524.9ZM882.9 591.2L886 611 1092.9 645.6 1455.7 608.2 1458.4 590.4 1092 622.1 1083.4 622.8ZM1308.7 940L1251.5 949.1 1272.6 524.9 1336 519.5ZM1328.3 381.2C1277.7 331.5 1175.8 491.5 1175.8 491.5L1178.7 502.5S1296.2 431.6 1332.9 428.5C1361.9 426 1361.3 449.9 1331.2 461.8 1303.7 472.6 1178.7 502.5 1178.7 502.5A747 747 0 0 0 1274.4 487.3C1351.9 473.5 1369.4 456.8 1369.9 431.4S1349.7 402.1 1328.3 381.2ZM1274.4 487.2C1349.2 473.9 1368.1 457.9 1369.8 434A63.5 63.5 0 0 0 1332.9 428.4C1361.9 425.9 1361.3 449.9 1331.2 461.7 1303.7 472.5 1178.7 502.4 1178.7 502.4H1178.7A880 880 0 0 0 1274.4 487.2ZM1249 462.9S1245.7 453.6 1229.5 452.2 1212.6 441.2 1212.6 441.1A594.4 594.4 0 0 0 1175.8 491.5L1178.7 502.5S1212.2 482.4 1249 463ZM1023.4 381.2C1073.9 331.5 1175.8 491.5 1175.8 491.5L1172.9 502.5S1055.4 431.6 1018.7 428.5C989.8 426 990.3 449.9 1020.5 461.8 1047.9 472.6 1172.9 502.5 1172.9 502.5A747 747 0 0 1 1077.3 487.3C999.8 473.5 982.2 456.8 981.7 431.4S1002 402.1 1023.4 381.2ZM1077.3 487.2C1002.5 473.9 983.5 457.9 981.9 434A63.5 63.5 0 0 1 1018.7 428.4C989.8 425.9 990.3 449.9 1020.5 461.7 1047.9 472.5 1172.9 502.4 1172.9 502.4H1172.9A880 880 0 0 1 1077.3 487.2ZM1102.6 462.9S1105.9 453.6 1122.1 452.2 1139.1 441.2 1139.1 441.1A595 595 0 0 1 1175.8 491.5L1172.9 502.5S1139.4 482.4 1102.6 463ZM1211.9 506H1135.9A5 5 0 0 1 1131.2 500.7H1131.2A16.4 16.4 0 0 1 1146.7 483.6H1201.1A16.4 16.4 0 0 1 1216.6 500.7H1216.6A5 5 0 0 1 1211.9 506ZM233.4 567L251.1 972.1 550.4 924.4 611.6 530ZM233.4 567L251.1 972.1 78 924.4 17.5 530ZM0 506L8.9 588.4 227.1 622.8 224.2 541.3ZM639.5 506L625.9 588.4 227.1 622.8 224.3 541.3ZM0 506L224.2 541.3 639.4 506 365.8 481.9ZM138.8 527.4L494.9 493.3 431.9 487.7 78 518.2ZM479.9 519.5L243.9 489.9 202.9 492.6 416.5 524.9ZM26.8 591.2L29.8 611 236.8 645.6 599.6 608.2 602.3 590.4 235.9 622.1 227.2 622.8ZM452.6 940L395.4 949.1 416.5 524.9 479.9 519.5ZM116.8 935.2L167.5 949.1 138.8 527.4 77.9 518.2ZM472.2 381.2C421.6 331.5 319.8 491.5 319.8 491.5L322.7 502.5S440.1 431.6 476.8 428.5C505.8 426 505.3 449.9 475.1 461.8 447.6 472.6 322.7 502.5 322.7 502.5A747 747 0 0 0 418.3 487.3C495.8 473.5 513.4 456.8 513.8 431.4S493.6 402.1 472.2 381.2ZM418.3 487.2C493.1 473.9 512.1 457.9 513.7 434A63.5 63.5 0 0 0 476.8 428.4C505.8 425.9 505.3 449.9 475.1 461.7 447.6 472.5 322.7 502.4 322.7 502.4H322.7A880 880 0 0 0 418.3 487.2ZM393 462.9S389.7 453.6 373.4 452.2 356.5 441.2 356.5 441.1A595.1 595.1 0 0 0 319.8 491.5L322.7 502.5S356.2 482.4 393 463ZM167.3 381.2C217.8 331.5 319.7 491.5 319.7 491.5L316.8 502.5S199.3 431.6 162.6 428.5C133.6 426 134.2 449.9 164.3 461.8 191.8 472.6 316.8 502.5 316.8 502.5A747 747 0 0 1 221.1 487.3C143.6 473.5 126.1 456.8 125.6 431.4S145.9 402.1 167.3 381.2ZM221.1 487.2C146.3 473.9 127.4 457.9 125.7 434A63.5 63.5 0 0 1 162.7 428.4C133.7 426 134.3 449.9 164.4 461.7 191.9 472.6 316.9 502.5 316.9 502.5H316.9A880.2 880.2 0 0 1 221.1 487.2ZM246.5 462.9S249.8 453.6 266.1 452.2 283 441.2 283 441.1A594.5 594.5 0 0 1 319.8 491.5L316.8 502.5S283.4 482.4 246.6 463ZM355.8 506H279.8A5 5 0 0 1 275.1 500.7H275.1A16.4 16.4 0 0 1 290.6 483.6H345A16.4 16.4 0 0 1 360.6 500.7H360.6A5 5 0 0 1 355.8 506ZM442.3 310.5L747.8 362.8 1053.3 310.5 747.8 276ZM595.1 336.7L747.8 362.9 900.6 336.7 747.8 319.4ZM905 493.5L868 497A388.3 388.3 0 0 1 1017.1 154.2 341.6 341.6 0 0 0 1005.2 189.2 271.6 271.6 0 0 1 1037.7 188.2 345.8 345.8 0 0 0 905 493.5ZM977.3 471.4L937.5 464.6C958 318.6 1048.8 196.5 1174.5 145.9A349.9 349.9 0 0 0 1153.7 179.4 299.7 299.7 0 0 1 1188.3 187.6 354.4 354.4 0 0 0 977.3 471.4ZM811.4 491.9L773.1 489.4A555.9 555.9 0 0 1 946.6 109.9 504.1 504.1 0 0 0 938.1 175.9 517.9 517.9 0 0 0 811.4 491.9ZM562.9 381.4L599.5 374.8A366.4 366.4 0 0 0 378.9 82.6 185.9 185.9 0 0 0 366.4 121.2 326.3 326.3 0 0 1 562.9 381.4ZM535.3 463.1L574.1 451.5C538.7 309 435.9 199.1 305.7 164.6A338.6 338.6 0 0 1 329.9 195.3 302.9 302.9 0 0 0 296.4 207.8 343.9 343.9 0 0 1 535.3 463.1ZM688.7 486.7L726.8 483A552.6 552.6 0 0 0 543.9 109 503.8 503.8 0 0 1 554 174.7 515.1 515.1 0 0 1 688.7 486.7ZM747.8 362.8V1000L985.2 937.7 1053.3 310.5ZM747.8 362.8V1000L510.4 937.7 442.3 310.5ZM973.1 823S943.9 837.1 937.9 904.5A135.6 135.6 0 0 1 925.4 953.4L848 973.7A166.3 166.3 0 0 0 871.7 919C879 883.9 879.9 875.1 879.9 875.1S884.8 854.4 935.2 826.3A61.6 61.6 0 0 1 973.1 823ZM879.9 875.2A105 105 0 0 1 927.1 804.3C1032.3 744.5 1161.9 869.9 1161.9 869.9L1143.7 867.9 1147.7 889.3 1126.3 886.3 1135.7 907 1115.5 902.6 1120.9 918.9 1099.4 912.9 1096.5 938.4S1034.2 853.5 998.2 838.5A100.5 100.5 0 0 0 879.9 875.2ZM522.5 823.1S550.4 840.7 559.5 909A160.3 160.3 0 0 0 570.1 953.4L647.6 973.9A166.4 166.4 0 0 1 623.9 919.1C616.6 884 615.7 875.3 615.7 875.3S610.8 854.6 560.3 826.5A61.6 61.6 0 0 0 522.5 823.1ZM615.7 875.3A105.1 105.1 0 0 0 568.5 804.4C463.3 744.7 333.7 870.1 333.7 870.1L351.9 868.1 347.8 889.5 369.3 886.5 359.9 907.2 380.1 902.8 374.7 919 396.2 913.1 399.1 938.6S463.9 854.9 499.8 839.8A96.5 96.5 0 0 1 615.7 875.3ZM463.6 75.2A38.7 38.7 0 0 0 437.4 56.9L441.1 31.4A62 62 0 0 1 482.9 60.6ZM902.8 42.4A41.8 41.8 0 0 0 882.1 67.7L859.9 59.4A66.8 66.8 0 0 1 893.1 18.9ZM1096.4 123.4A32.9 32.9 0 0 0 1070.9 134.7L1056.2 118.6A52.7 52.7 0 0 1 1096.9 100.4ZM773.5 28.6A41.4 41.4 0 0 0 768.4 58.4L748.3 63.4A66.3 66.3 0 0 1 756.3 15.8ZM632.6 122.7A38.6 38.6 0 0 0 617.6 97.3L629.1 78.3A61.8 61.8 0 0 1 653 118.9ZM206 205.9A34.3 34.3 0 0 0 179.8 193.4Q179.8 181.5 179.8 169.6A55 55 0 0 1 221.6 189.6ZM1171.1 285.2A61.2 61.2 0 0 0 1138.9 287.6 83.4 83.4 0 0 1 1197.3 250.9Q1198.5 262.3 1199.6 273.8A60.3 60.3 0 0 0 1171.1 285.2ZM828.8 208.3A75.2 75.2 0 0 0 810.9 238.1 102.1 102.1 0 0 1 819.9 164.4L837.8 176.3A75.9 75.9 0 0 0 828.8 208.3ZM284 117.2A61.7 61.7 0 0 1 315.8 123.5 85.9 85.9 0 0 0 261.4 79.7L256.8 102.2A61.8 61.8 0 0 1 284 117.2ZM278.4 313.3A59.7 59.7 0 0 1 350.7 314.2L360.8 305.2A64.5 64.5 0 0 0 264.1 293.9ZM221.7 4.5L253 0 274.9 19.2 223.6 20.3ZM728.1 145.8L739 178.5 726.9 206.3 714.7 151.2ZM1240.6 60.6L1209.4 66.5 1193.7 92.1 1243 76.4Z", + "width": 1496 + }, + "search": [ + "offer_icon" + ] + }, + { + "uid": "48bf5922e89257ff0ba5f3ae4a47297d", + "css": "prescription_icon", + "code": 59403, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M466 297H414.1V245A19.5 19.5 0 1 0 374.9 245V297H323A19.5 19.5 0 0 0 323 336.1H374.9V388A19.5 19.5 0 0 0 414.1 388V336.1H466A19.5 19.5 0 1 0 466 297ZM394.5 144.6A171.9 171.9 0 1 0 566.4 316.5 172.1 172.1 0 0 0 394.5 144.6ZM394.5 449.3A132.8 132.8 0 1 1 527.3 316.5 133 133 0 0 1 394.5 449.3ZM783.4 179.6L609.5 5.7A19.5 19.5 0 0 0 595.7 0H58.6A58.7 58.7 0 0 0 0 58.6V941.4A58.7 58.7 0 0 0 58.6 1000H431.7A19.5 19.5 0 1 0 431.7 960.8H58.6A19.6 19.6 0 0 1 39.2 941.4V58.6A19.6 19.6 0 0 1 58.7 39.1H576.2V154.2A58.7 58.7 0 0 0 634.8 212.8H750.1V560.5A19.5 19.5 0 1 0 789.2 560.5V193.4A19.5 19.5 0 0 0 783.4 179.6ZM634.8 173.8A19.6 19.6 0 0 1 615.2 154.3V66.7L722.4 173.8H634.8ZM644.5 546.9H305.3A19.5 19.5 0 0 0 305.3 586.1H644.5A19.5 19.5 0 0 0 644.5 546.9ZM208.2 546.9H144.5A19.5 19.5 0 0 0 144.5 586.1H208.2A19.5 19.5 0 0 0 208.2 546.9ZM500 656.3H305.3A19.5 19.5 0 0 0 305.3 695.4H500A19.5 19.5 0 1 0 500 656.3ZM208.2 656.3H144.5A19.5 19.5 0 0 0 144.5 695.4H208.2A19.5 19.5 0 0 0 208.2 656.3ZM319.1 771.4A19.5 19.5 0 1 0 324.9 785.2 19.6 19.6 0 0 0 319.1 771.4ZM208.2 765.6H144.5A19.5 19.5 0 1 0 144.5 804.8H208.2A19.5 19.5 0 1 0 208.2 765.6ZM879 757.8A121.3 121.3 0 0 0 862.1 759 121.1 121.1 0 0 0 660.5 638.6L505.8 793.3A121.1 121.1 0 0 0 677 964.5L758 883.6A121.1 121.1 0 1 0 878.9 757.9ZM649.4 936.9A82 82 0 1 1 533.4 820.9L597 757.4 713 873.4ZM740.6 845.8L624.6 729.8 688.1 666.2A82 82 0 1 1 804.1 782.2ZM859.4 958.6A82 82 0 0 1 859.4 799.3ZM898.6 958.6V799.3A82 82 0 0 1 898.6 958.6Z", + "width": 1000 + }, + "search": [ + "prescription_icon" + ] + }, + { + "uid": "fce0d47a8f283966d22c8450b4c63f70", + "css": "search_scan_icon", + "code": 59404, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M846.2 544.3A19.5 19.5 0 0 1 828.4 532.9 74.4 74.4 0 0 0 729.8 496.2 19.5 19.5 0 0 1 713.5 460.7 113.5 113.5 0 0 1 863.9 516.6 19.5 19.5 0 0 1 846.2 544.3ZM185.6 174.1V500A19.5 19.5 0 0 0 224.7 500V174.1A19.5 19.5 0 0 0 185.6 174.1ZM305.5 465.2V174.1A19.5 19.5 0 0 0 266.4 174.1V465.2A19.5 19.5 0 0 0 305.5 465.2ZM347.2 454.6A19.5 19.5 0 0 0 386.3 454.6V453.1A19.5 19.5 0 1 0 347.2 453.1ZM366.7 389.9A19.5 19.5 0 0 0 386.2 370.4V174.1A19.5 19.5 0 0 0 347.2 174.1V370.4A19.5 19.5 0 0 0 366.7 389.9ZM467 500V174.1A19.5 19.5 0 0 0 428 174.1V500A19.5 19.5 0 1 0 467 500ZM528.3 389.9A19.5 19.5 0 0 0 547.8 370.4V174.1A19.5 19.5 0 1 0 508.7 174.1V370.4A19.5 19.5 0 0 0 528.3 389.9ZM508.7 454.6A19.5 19.5 0 0 0 547.8 454.6V453.1A19.5 19.5 0 1 0 508.7 453.1ZM249.5 96.4A19.5 19.5 0 0 0 230 76.9H96.3A19.5 19.5 0 0 0 76.8 96.4V230.3A19.5 19.5 0 1 0 115.9 230.3V116H230A19.5 19.5 0 0 0 249.5 96.4ZM76.8 597.8A19.5 19.5 0 0 0 96.3 617.3H230A19.5 19.5 0 0 0 230 578.2H115.9V463.9A19.5 19.5 0 1 0 76.8 463.9ZM798.7 249.8A19.5 19.5 0 0 0 818.2 230.3V96.4A19.5 19.5 0 0 0 798.7 76.9H665A19.5 19.5 0 0 0 665 116H779.1V230.3A19.5 19.5 0 0 0 798.7 249.8ZM993.4 896.6L944.6 790.7A19.5 19.5 0 0 0 918.7 781.1L888.1 795.2 859.6 732.9A196 196 0 0 0 895 421.4V52.9A52.9 52.9 0 0 0 842.3 0H52.8A52.9 52.9 0 0 0-0.1 52.9V259.3A19.5 19.5 0 0 0 39 259.3V52.9A13.8 13.8 0 0 1 52.7 39.1H842.3A13.8 13.8 0 0 1 856 52.9V392.8A198.1 198.1 0 0 0 829.1 380.3 193.8 193.8 0 0 0 709.5 374.9V174.1A19.5 19.5 0 1 0 670.4 174.1V390.5A194.3 194.3 0 0 0 628.6 419.9V174.1A19.5 19.5 0 0 0 589.5 174.1V469.9A195.7 195.7 0 0 0 583.2 645.4C584.7 648.7 586.3 651.9 588 655.1H52.8A13.8 13.8 0 0 1 39.1 641.3V434.9A19.5 19.5 0 1 0-0.1 434.9V641.4A52.9 52.9 0 0 0 52.7 694.3H614.8A194.8 194.8 0 0 0 824 749.2L852.5 811.7 821.8 825.9A19.5 19.5 0 0 0 812.3 851.8L861 957.8A72.8 72.8 0 0 0 993.3 896.8ZM826 706.4A156.2 156.2 0 0 1 618.7 629.2 156.9 156.9 0 0 1 695.8 421.5 156.5 156.5 0 0 1 862.7 444.9L863.1 445.3A156.9 156.9 0 0 1 826 706.4ZM941.3 957.8A33.2 33.2 0 0 1 915.7 958.8 33.6 33.6 0 0 1 896.6 941.3L856 853 917.3 824.9 957.8 913A33.9 33.9 0 0 1 941.2 958ZM19.5 366.7A19.5 19.5 0 1 0-0.1 347V347A19.5 19.5 0 0 0 19.5 366.7Z", + "width": 1000 + }, + "search": [ + "search_scan_icon" + ] + }, + { + "uid": "4aab61c6fa11812333db81c2bb204c83", + "css": "share_icon", + "code": 59405, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M872.7 173.8A139.7 139.7 0 1 1 732.9 34.1 139.7 139.7 0 0 1 872.7 173.8ZM313.7 500A139.7 139.7 0 1 1 173.8 360.2 139.7 139.7 0 0 1 313.7 500ZM872.7 826.1A139.7 139.7 0 1 1 732.9 686.4 139.7 139.7 0 0 1 872.7 826.1ZM294.6 570.3L612.8 755.8M612.3 244.2L294.6 429.7", + "width": 907 + }, + "search": [ + "share_icon" + ] + }, + { + "uid": "65fb587059226e09ea7e14cd39772bb1", + "css": "wishlist_add_icon", + "code": 59406, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M785.4 0A320.4 320.4 0 0 0 541.7 114.3 320.4 320.4 0 0 0 297.9 0 294.5 294.5 0 0 0 0 299.7C0 506.8 184.1 673 463 929.4L541.7 1000.3 620.4 929.4C899.2 673.2 1083.4 507.1 1083.4 299.7A294.5 294.5 0 0 0 785.4 0Z", + "width": 1083 + }, + "search": [ + "wishlist_add_icon" + ] + }, + { + "uid": "c752092fa3a1a55f5bc0ae60f4beb4c7", + "css": "wishlist_icon", + "code": 59407, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M785.4 0A320.4 320.4 0 0 0 541.7 114.3 320.4 320.4 0 0 0 297.9 0 294.5 294.5 0 0 0 0 299.7C0 506.8 184.1 673 463 929.4L541.7 1000.3 620.4 929.4C899.2 673.2 1083.4 507.1 1083.4 299.7A294.5 294.5 0 0 0 785.4 0ZM575 857.5L564 867.7 541.6 888 519.2 867.7 508.2 857.5A3310.1 3310.1 0 0 1 188.7 539.8 382.1 382.1 0 0 1 83.6 299.7 216.7 216.7 0 0 1 145.4 145.3 211.9 211.9 0 0 1 298 83.4 238.8 238.8 0 0 1 478 168L541.7 243.8 605.5 168A237.9 237.9 0 0 1 785.4 83.4 212.9 212.9 0 0 1 938.3 145.3 217.1 217.1 0 0 1 1000.1 299.7 384.1 384.1 0 0 1 894.8 539.8 3316.8 3316.8 0 0 1 575 857.5Z", + "width": 1083 + }, + "search": [ + "wishlist_icon" + ] + }, + { + "uid": "88b990d06e49752b331bb5c6704b3d42", + "css": "bg_1", + "code": 59408, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M80.6 6.2H2052.5A74.4 74.4 0 0 1 2126.9 80.6V923.9A74.4 74.4 0 0 1 2052.5 998.3H80.6A74.4 74.4 0 0 1 6.2 923.9V80.6A74.4 74.4 0 0 1 80.6 6.2ZM1063.2 993.8H1037.3L1039 992.1 1036 993.8H987.3L1020.5 981.6 889 993.8H29.8A52.5 52.5 0 0 1 6.2 946.5V867.8L1027.4 962.7 6.2 565.1V321L1034.3 947 89.8 6.2H367.8L1039.9 927.1 645.9 6.2H809L1059.9 937.4 996.5 6.2H1136.5L1074.3 920.2V920.2L1335.1 6.2H1499.5L1081.7 942.6 1765.2 6.2H2043.3L1103.6 942.1V942.1L1103.6 942.1 2126.9 344.5V586.4L1102.1 963.1 2126.9 867.9V946.5A52.5 52.5 0 0 1 2103.3 993.8H1243.6L1103.2 980.8 1136.7 993.8H1063.2Z", + "width": 2133 + }, + "search": [ + "bg_1" + ] + }, + { + "uid": "ace5228aabf92ff4bf5524cef4c6409f", + "css": "bg_2", + "code": 59409, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M75 1000A75 75 0 0 1 0 925V75A75 75 0 0 1 75 0H2062.5A75 75 0 0 1 2137.5 75V925A75 75 0 0 1 2062.5 1000ZM2142 792.6C2084.5 793.1 2087.9 773.2 2043.5 760.2S1990.1 764.4 1953.4 739.3 1930.2 698.9 1905.4 667 1863.7 645 1847.6 605.3 1850.5 559.6 1845.2 519.5 1820.1 479 1824.9 436.1 1848.9 397.8 1863.1 360.3 1860.4 312.2 1886.3 277.7 1926 257.1 1960.1 232.7 1984.7 190.3 2031.5 175.4 2082.4 179.8 2136.4 179.3M2141.7 750.7C2091.8 751.2 2095.1 731.3 2057.1 720.2S2009.8 726.4 1977.9 704.4 1959.6 667.4 1938.2 640 1900 622.7 1886 588.1 1890.9 547.8 1886.4 513.3 1862.3 478.7 1866.5 441.5 1889.7 409.1 1902 376.8 1897.2 334 1919.7 304.1 1956 288 1985.3 267.1 2005.1 228.2 2045.8 215.3 2090.2 221.5 2136.6 221.1M2141.3 711.9C2098.5 712.2 2101.8 692.5 2069.6 683S2028.1 690.9 2000.7 672 1987 638.3 1968.8 615 1933.8 601.9 1921.9 572.2 1928.8 536.8 1925 507.6 1901.4 478.2 1905.1 446.4 1927.7 419.2 1938.2 391.9 1931.5 354 1950.6 328.4 1983.7 316.9 2008.8 298.9 2024.1 263.2 2059.1 252.3 2097.8 260.4 2137.1 260M742.2 1004.9C740.7 947.4 760.5 950.5 772.8 905.9S767.6 852.6 792.1 815.5 832 791.6 863.4 766.3 884.6 724.1 924.1 707.4 969.8 709.4 1009.8 703.4 1049.8 677.6 1092.7 681.7 1131.4 704.9 1169.1 718.5 1217.1 714.9 1252.1 740.1 1273.4 779.4 1298.4 813.1 1341.2 837 1356.9 883.4 1353.5 934.3 1354.9 988.3M784 1003.8C782.6 954 802.5 956.9 813 918.7S806 871.7 827.4 839.3 864 820.4 890.9 798.5 907.6 760 941.9 745.4 982.3 749.6 1016.6 744.5 1050.8 719.8 1088 723.3 1120.9 745.9 1153.4 757.6 1196 752.1 1226.4 774 1243.1 810 1264.5 838.9 1303.7 858 1317.4 898.4 1311.9 942.9 1313.1 989.2M822.8 1002.7C821.7 960 841.5 962.9 850.4 930.5S841.7 889.3 860.1 861.5 893.5 847.3 916.5 828.7 929 793.4 958.4 781 993.9 787.3 1023.1 782.9 1052 758.8 1083.9 762 1111.4 784.1 1138.9 794 1176.6 786.6 1202.5 805.4 1214.7 838.2 1233.1 862.9 1269 877.6 1280.6 912.4 1273.2 951.2 1274.3 990.5", + "width": 2138 + }, + "search": [ + "bg_2" + ] + }, + { + "uid": "0887f8af7107badceb2618215c9d8053", + "css": "bg_3", + "code": 59410, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M808.5 441.7C833.6 416.6 869 452 894.1 426.9S883.8 366.4 908.9 341.3 969.4 351.6 994.5 326.4 984.2 266 1009.4 240.9 1069.8 251.1 1094.9 226 1084.7 165.5 1109.8 140.4 1170.3 150.6 1195.4 125.5 1185.2 65.1 1210.3 39.9 1270.8 50.1 1295.9 25M85.1 848.6C120.5 851.1 117 901 152.4 903.5S191.3 856.1 226.7 858.5 258.7 910.9 294.1 913.4 333 866 368.4 868.4 400.4 920.8 435.8 923.3 474.7 875.9 510.2 878.3 542.1 930.7 577.5 933.2 616.5 885.8 651.9 888.3 683.9 940.6 719.4 943.1", + "width": 2138 + }, + "search": [ + "bg_3" + ] + }, + { + "uid": "15d14398ff70be8823b96215f803bf80", + "css": "bg_4", + "code": 59411, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M1546 479.2C1571.1 454.1 1606.5 489.5 1631.6 464.4S1621.3 403.9 1646.4 378.8 1706.9 389.1 1732 363.9 1721.7 303.5 1746.9 278.4 1807.3 288.6 1832.4 263.5 1822.2 203 1847.3 177.9 1907.8 188.1 1932.9 163 1922.7 102.6 1947.8 77.4 2008.3 87.6 2033.4 62.5M1354.2 796L1262.5 743.1V849ZM1549.7 796L1458.1 743.1V849ZM1745.3 796L1653.6 743.1V849Z", + "width": 2138 + }, + "search": [ + "bg_4" + ] + }, + { + "uid": "1ad61f1d7131991dd2361861dd272499", + "css": "medication_icon", + "code": 59412, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M578.7 308A105.9 105.9 0 0 0 476.3 229.1 106.8 106.8 0 0 0 384.1 282.2L317.1 398.2V398.2L250.1 514.2A106.3 106.3 0 0 0 428.9 628.6Q429.2 628.2 429.4 627.8L568.1 388.5A105.3 105.3 0 0 0 578.7 308ZM411.4 616.8A85.1 85.1 0 0 1 268.4 524.8L330.1 418 353 431.2H353L477.4 503ZM549.8 377.9L487.9 484.6 372.7 418.1 402.3 366.9A10.6 10.6 0 0 0 383.9 356.3L354.4 407.6 340.6 399.6 402.3 292.8A85.6 85.6 0 0 1 476.3 250.3 85.1 85.1 0 0 1 549.6 377.8ZM718.7 591.9A407.8 407.8 0 0 0 526.8 591.9C496.1 600.6 480.5 613 480.5 628.6 480.5 628.6 480.5 628.6 480.5 628.6V722.6C480.5 738.4 496 750.6 526.7 759.4A409.2 409.2 0 0 0 718.7 759.4C749.4 750.7 765 738.3 765 722.6V628.6L765 628.6C765 613 749.4 600.7 718.7 591.9ZM532.6 612.2A387.3 387.3 0 0 1 712.8 612.2C738.3 619.5 743.8 627.4 743.8 628.6H743.8C743.8 629.9 738.3 637.7 712.9 645A387.3 387.3 0 0 1 532.6 645C507 637.7 501.6 629.9 501.6 628.6S507 619.5 532.6 612.2ZM743.8 722.7C743.8 724.2 738.3 731.9 712.9 739.1A388.7 388.7 0 0 1 532.5 739.1C507.1 731.9 501.6 724.2 501.6 722.7V655.7A130.1 130.1 0 0 0 526.8 665.4 407.7 407.7 0 0 0 718.7 665.4 130.2 130.2 0 0 0 743.8 655.7V682.1A222 222 0 0 1 688.6 699.8 10.6 10.6 0 1 0 692.6 720.6 257.9 257.9 0 0 0 743.8 705.4ZM414.4 324.9A10.6 10.6 0 0 0 399.9 328.8L399.7 329.1A10.6 10.6 0 1 0 418.1 339.6L418.2 339.3A10.6 10.6 0 0 0 414.4 324.9ZM669.4 713.7A10.6 10.6 0 0 0 657.8 704.2H657.6A10.6 10.6 0 0 0 658.6 725.3L659.6 725.3 659.9 725.3A10.6 10.6 0 0 0 669.4 713.7ZM999.5 500A500 500 0 0 1 499.5 1000 35.7 35.7 0 1 1 499.5 928.6 428.6 428.6 0 0 0 821 217.1V250A35.7 35.7 0 0 1 749.5 250V107.1A35.7 35.7 0 0 1 785.2 71.4H928.1A35.7 35.7 0 1 1 928.1 142.9H820.9V145.7A35.7 35.7 0 0 1 860.2 153.9 496.8 496.8 0 0 1 999.5 500ZM213.8 678.6A35.7 35.7 0 0 0 178.1 714.3V782.9A428.6 428.6 0 0 1 499.5 71.4 35.7 35.7 0 1 0 499.5 0 500 500 0 0 0 116.9 821.4H70.9A35.7 35.7 0 1 0 70.9 892.8H213.8A35.7 35.7 0 0 0 249.6 857.2V714.3A35.7 35.7 0 0 0 213.8 678.6Z", + "width": 1000 + }, + "search": [ + "medication_icon" + ] } ] -} +} \ No newline at end of file diff --git a/assets/app_icons/fonts/DQIcons.ttf b/assets/app_icons/fonts/DQIcons.ttf index 8365db47..474ea22c 100644 Binary files a/assets/app_icons/fonts/DQIcons.ttf and b/assets/app_icons/fonts/DQIcons.ttf differ diff --git a/assets/fonts/ar/Cairo-Bold/Cairo-Bold.eot b/assets/fonts/ar/Cairo-Bold/Cairo-Bold.eot new file mode 100644 index 00000000..ed5f0c34 Binary files /dev/null and b/assets/fonts/ar/Cairo-Bold/Cairo-Bold.eot differ diff --git a/assets/fonts/ar/Cairo-Bold/Cairo-Bold.otf b/assets/fonts/ar/Cairo-Bold/Cairo-Bold.otf new file mode 100644 index 00000000..8bc25fbb Binary files /dev/null and b/assets/fonts/ar/Cairo-Bold/Cairo-Bold.otf differ diff --git a/assets/fonts/ar/Cairo-Bold/Cairo-Bold.ttf b/assets/fonts/ar/Cairo-Bold/Cairo-Bold.ttf new file mode 100644 index 00000000..4f026897 Binary files /dev/null and b/assets/fonts/ar/Cairo-Bold/Cairo-Bold.ttf differ diff --git a/assets/fonts/ar/Cairo-Bold/Cairo-Bold.woff b/assets/fonts/ar/Cairo-Bold/Cairo-Bold.woff new file mode 100644 index 00000000..91e3d063 Binary files /dev/null and b/assets/fonts/ar/Cairo-Bold/Cairo-Bold.woff differ diff --git a/assets/fonts/ar/Cairo-Light/Cairo-Light.eot b/assets/fonts/ar/Cairo-Light/Cairo-Light.eot new file mode 100644 index 00000000..d76c5391 Binary files /dev/null and b/assets/fonts/ar/Cairo-Light/Cairo-Light.eot differ diff --git a/assets/fonts/ar/Cairo-Light/Cairo-Light.otf b/assets/fonts/ar/Cairo-Light/Cairo-Light.otf new file mode 100644 index 00000000..f8812a9c Binary files /dev/null and b/assets/fonts/ar/Cairo-Light/Cairo-Light.otf differ diff --git a/assets/fonts/ar/Cairo-Light/Cairo-Light.ttf b/assets/fonts/ar/Cairo-Light/Cairo-Light.ttf new file mode 100644 index 00000000..840cbc3e Binary files /dev/null and b/assets/fonts/ar/Cairo-Light/Cairo-Light.ttf differ diff --git a/assets/fonts/ar/Cairo-Light/Cairo-Light.woff b/assets/fonts/ar/Cairo-Light/Cairo-Light.woff new file mode 100644 index 00000000..9534bb4b Binary files /dev/null and b/assets/fonts/ar/Cairo-Light/Cairo-Light.woff differ diff --git a/assets/fonts/en/WorkSans-Bold/WorkSans-Bold.eot b/assets/fonts/en/WorkSans-Bold/WorkSans-Bold.eot new file mode 100644 index 00000000..98bc2468 Binary files /dev/null and b/assets/fonts/en/WorkSans-Bold/WorkSans-Bold.eot differ diff --git a/assets/fonts/en/WorkSans-Bold/WorkSans-Bold.otf b/assets/fonts/en/WorkSans-Bold/WorkSans-Bold.otf new file mode 100644 index 00000000..73f8bf0a Binary files /dev/null and b/assets/fonts/en/WorkSans-Bold/WorkSans-Bold.otf differ diff --git a/assets/fonts/en/WorkSans-Bold/WorkSans-Bold.ttf b/assets/fonts/en/WorkSans-Bold/WorkSans-Bold.ttf new file mode 100644 index 00000000..177a3b67 Binary files /dev/null and b/assets/fonts/en/WorkSans-Bold/WorkSans-Bold.ttf differ diff --git a/assets/fonts/en/WorkSans-Bold/WorkSans-Bold.woff b/assets/fonts/en/WorkSans-Bold/WorkSans-Bold.woff new file mode 100644 index 00000000..8d7013cd Binary files /dev/null and b/assets/fonts/en/WorkSans-Bold/WorkSans-Bold.woff differ diff --git a/assets/fonts/en/WorkSans-Light/WorkSans-Light_0.eot b/assets/fonts/en/WorkSans-Light/WorkSans-Light_0.eot new file mode 100644 index 00000000..9541e418 Binary files /dev/null and b/assets/fonts/en/WorkSans-Light/WorkSans-Light_0.eot differ diff --git a/assets/fonts/en/WorkSans-Light/WorkSans-Light_0.otf b/assets/fonts/en/WorkSans-Light/WorkSans-Light_0.otf new file mode 100644 index 00000000..be5e0ac4 Binary files /dev/null and b/assets/fonts/en/WorkSans-Light/WorkSans-Light_0.otf differ diff --git a/assets/fonts/en/WorkSans-Light/WorkSans-Light_0.ttf b/assets/fonts/en/WorkSans-Light/WorkSans-Light_0.ttf new file mode 100644 index 00000000..0b010ade Binary files /dev/null and b/assets/fonts/en/WorkSans-Light/WorkSans-Light_0.ttf differ diff --git a/assets/fonts/en/WorkSans-Light/WorkSans-Light_0.woff b/assets/fonts/en/WorkSans-Light/WorkSans-Light_0.woff new file mode 100644 index 00000000..12226d75 Binary files /dev/null and b/assets/fonts/en/WorkSans-Light/WorkSans-Light_0.woff differ diff --git a/assets/fonts/en/WorkSans-Light/WorkSans-Regular.otf b/assets/fonts/en/WorkSans-Light/WorkSans-Regular.otf new file mode 100644 index 00000000..be88832e Binary files /dev/null and b/assets/fonts/en/WorkSans-Light/WorkSans-Regular.otf differ diff --git a/assets/fonts/en/WorkSans-Light/WorkSans-Regular.ttf b/assets/fonts/en/WorkSans-Light/WorkSans-Regular.ttf new file mode 100644 index 00000000..0ac4520a Binary files /dev/null and b/assets/fonts/en/WorkSans-Light/WorkSans-Regular.ttf differ diff --git a/assets/fonts/en/WorkSans-Light/WorkSans-Regular.woff b/assets/fonts/en/WorkSans-Light/WorkSans-Regular.woff new file mode 100644 index 00000000..89af38b8 Binary files /dev/null and b/assets/fonts/en/WorkSans-Light/WorkSans-Regular.woff differ diff --git a/assets/images/AlHabibMedicalService/Wifi-AR.png b/assets/images/AlHabibMedicalService/Wifi-AR.png new file mode 100644 index 00000000..a8e2d9af Binary files /dev/null and b/assets/images/AlHabibMedicalService/Wifi-AR.png differ diff --git a/assets/images/SmartWatches/Apple-Watch-6.png b/assets/images/SmartWatches/Apple-Watch-6.png new file mode 100644 index 00000000..1e670506 Binary files /dev/null and b/assets/images/SmartWatches/Apple-Watch-6.png differ diff --git a/assets/images/SmartWatches/apple-watch-1.jpeg b/assets/images/SmartWatches/apple-watch-1.jpeg new file mode 100644 index 00000000..7262e7eb Binary files /dev/null and b/assets/images/SmartWatches/apple-watch-1.jpeg differ diff --git a/assets/images/SmartWatches/apple-watch-2.jpg b/assets/images/SmartWatches/apple-watch-2.jpg new file mode 100644 index 00000000..f688f740 Binary files /dev/null and b/assets/images/SmartWatches/apple-watch-2.jpg differ diff --git a/assets/images/SmartWatches/apple-watch-3.jpg b/assets/images/SmartWatches/apple-watch-3.jpg new file mode 100644 index 00000000..b68c1ced Binary files /dev/null and b/assets/images/SmartWatches/apple-watch-3.jpg differ diff --git a/assets/images/SmartWatches/apple-watch-4.jpg b/assets/images/SmartWatches/apple-watch-4.jpg new file mode 100644 index 00000000..2fc19b67 Binary files /dev/null and b/assets/images/SmartWatches/apple-watch-4.jpg differ diff --git a/assets/images/SmartWatches/apple-watch-5.jpg b/assets/images/SmartWatches/apple-watch-5.jpg new file mode 100644 index 00000000..4c497eac Binary files /dev/null and b/assets/images/SmartWatches/apple-watch-5.jpg differ diff --git a/assets/images/SmartWatches/fossil-sport.png b/assets/images/SmartWatches/fossil-sport.png new file mode 100644 index 00000000..207bbbe3 Binary files /dev/null and b/assets/images/SmartWatches/fossil-sport.png differ diff --git a/assets/images/SmartWatches/heartrate_icon.png b/assets/images/SmartWatches/heartrate_icon.png new file mode 100644 index 00000000..e228bea4 Binary files /dev/null and b/assets/images/SmartWatches/heartrate_icon.png differ diff --git a/assets/images/SmartWatches/huawei-watch-2-classic.png b/assets/images/SmartWatches/huawei-watch-2-classic.png new file mode 100644 index 00000000..0dc44cb6 Binary files /dev/null and b/assets/images/SmartWatches/huawei-watch-2-classic.png differ diff --git a/assets/images/SmartWatches/huawei-watch-2.png b/assets/images/SmartWatches/huawei-watch-2.png new file mode 100644 index 00000000..61530239 Binary files /dev/null and b/assets/images/SmartWatches/huawei-watch-2.png differ diff --git a/assets/images/SmartWatches/lg-watch-sport.jpg b/assets/images/SmartWatches/lg-watch-sport.jpg new file mode 100644 index 00000000..bd2f25ed Binary files /dev/null and b/assets/images/SmartWatches/lg-watch-sport.jpg differ diff --git a/assets/images/SmartWatches/miBand3.jpg b/assets/images/SmartWatches/miBand3.jpg new file mode 100644 index 00000000..c58f85e5 Binary files /dev/null and b/assets/images/SmartWatches/miBand3.jpg differ diff --git a/assets/images/SmartWatches/miBand4.jpg b/assets/images/SmartWatches/miBand4.jpg new file mode 100644 index 00000000..519ef5fb Binary files /dev/null and b/assets/images/SmartWatches/miBand4.jpg differ diff --git a/assets/images/SmartWatches/misfit-vapor-2.jpg b/assets/images/SmartWatches/misfit-vapor-2.jpg new file mode 100644 index 00000000..fe487591 Binary files /dev/null and b/assets/images/SmartWatches/misfit-vapor-2.jpg differ diff --git a/assets/images/SmartWatches/sleep_data.png b/assets/images/SmartWatches/sleep_data.png new file mode 100644 index 00000000..dc6661d6 Binary files /dev/null and b/assets/images/SmartWatches/sleep_data.png differ diff --git a/assets/images/SmartWatches/ticwatche2.png b/assets/images/SmartWatches/ticwatche2.png new file mode 100644 index 00000000..5ad3d308 Binary files /dev/null and b/assets/images/SmartWatches/ticwatche2.png differ diff --git a/assets/images/female_face.png b/assets/images/female_face.png new file mode 100644 index 00000000..be8ed225 Binary files /dev/null and b/assets/images/female_face.png differ diff --git a/assets/images/male_face.png b/assets/images/male_face.png new file mode 100644 index 00000000..7adf335a Binary files /dev/null and b/assets/images/male_face.png differ diff --git a/assets/images/pharmacy_module/bg_1.png b/assets/images/pharmacy_module/bg_1.png new file mode 100644 index 00000000..9505e556 Binary files /dev/null and b/assets/images/pharmacy_module/bg_1.png differ diff --git a/assets/images/pharmacy_module/bg_2.png b/assets/images/pharmacy_module/bg_2.png new file mode 100644 index 00000000..96cfd3bc Binary files /dev/null and b/assets/images/pharmacy_module/bg_2.png differ diff --git a/assets/images/pharmacy_module/bg_3.png b/assets/images/pharmacy_module/bg_3.png new file mode 100644 index 00000000..127c2669 Binary files /dev/null and b/assets/images/pharmacy_module/bg_3.png differ diff --git a/assets/images/pharmacy_module/bg_4.png b/assets/images/pharmacy_module/bg_4.png new file mode 100644 index 00000000..423ab421 Binary files /dev/null and b/assets/images/pharmacy_module/bg_4.png differ diff --git a/assets/images/pharmacy_module/medication_icon.png b/assets/images/pharmacy_module/medication_icon.png new file mode 100644 index 00000000..95851e4e Binary files /dev/null and b/assets/images/pharmacy_module/medication_icon.png differ diff --git a/assets/images/pharmacy_module/offer_icon.png b/assets/images/pharmacy_module/offer_icon.png new file mode 100644 index 00000000..64db2b76 Binary files /dev/null and b/assets/images/pharmacy_module/offer_icon.png differ diff --git a/assets/images/pharmacy_module/pharmacy_logo_green.png b/assets/images/pharmacy_module/pharmacy_logo_green.png new file mode 100644 index 00000000..13c076b0 Binary files /dev/null and b/assets/images/pharmacy_module/pharmacy_logo_green.png differ diff --git a/assets/images/pharmacy_module/prescription_icon.png b/assets/images/pharmacy_module/prescription_icon.png new file mode 100644 index 00000000..740004c7 Binary files /dev/null and b/assets/images/pharmacy_module/prescription_icon.png differ diff --git a/assets/images/pharmacy_module/search_scan_icon.png b/assets/images/pharmacy_module/search_scan_icon.png new file mode 100644 index 00000000..d168b0e6 Binary files /dev/null and b/assets/images/pharmacy_module/search_scan_icon.png differ diff --git a/heartrate_icon.png b/heartrate_icon.png new file mode 100644 index 00000000..e228bea4 Binary files /dev/null and b/heartrate_icon.png differ diff --git a/ios/Runner/AppDelegate.swift b/ios/Runner/AppDelegate.swift index 70693e4a..23dd69b8 100644 --- a/ios/Runner/AppDelegate.swift +++ b/ios/Runner/AppDelegate.swift @@ -1,5 +1,6 @@ import UIKit import Flutter +import GoogleMaps @UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { @@ -7,6 +8,7 @@ import Flutter _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? ) -> Bool { + GMSServices.provideAPIKey("AIzaSyCiiJiHkocPbcziHt9O8rGWavDrxHRQys8") GeneratedPluginRegistrant.register(with: self) return super.application(application, didFinishLaunchingWithOptions: launchOptions) } diff --git a/lib/config/config.dart b/lib/config/config.dart index dd6e612a..9e64d9cb 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -6,7 +6,7 @@ import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart'; const MAX_SMALL_SCREEN = 660; -const BASE_URL = 'https://hmgwebservices.com/'; +const BASE_URL = 'https://uat.hmgwebservices.com/'; const PHARMACY_BASE_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; @@ -59,9 +59,16 @@ const GET_NEAREST_HOSPITAL = 'Services/Patients.svc/REST/Patient_GetProjectAvgERWaitingTime'; ///Er Nearest -const GET_AMBULANCE_REQUEST = 'Services/Patients.svc/REST/PatientER_RRT_GetAllTransportationMethod'; -const GET_PATIENT_ALL_PRES_ORDERS= 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; -const GET_PICK_UP_REQUEST_BY_PRES_ORDER_ID= 'Services/Patients.svc/REST/PatientER_RRT_GetPickUpRequestByPresOrderID'; +const GET_AMBULANCE_REQUEST = + 'Services/Patients.svc/REST/PatientER_RRT_GetAllTransportationMethod'; +const GET_PATIENT_ALL_PRES_ORDERS = + 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; +const GET_PICK_UP_REQUEST_BY_PRES_ORDER_ID = + 'Services/Patients.svc/REST/PatientER_RRT_GetPickUpRequestByPresOrderID'; +const UPDATE_PRESS_ORDER = + 'Services/Patients.svc/REST/PatientER_UpdatePresOrder'; +const INSERT_ER_INERT_PRES_ORDER = + 'Services/Patients.svc/REST/PatientER_InsertPresOrder'; ///FindUs const GET_FINDUS_REQUEST = 'Services/Lists.svc/REST/Get_HMG_Locations'; @@ -141,7 +148,8 @@ const GET_PATIENT_SHARE = "Services/Doctors.svc/REST/GetCheckinScreenAppointmentDetailsByAppointmentNO"; //URL to get patient appointment history -const GET_PATIENT_APPOINTMENT_HISTORY = "Services/Doctors.svc/REST/PateintHasAppoimentHistory"; +const GET_PATIENT_APPOINTMENT_HISTORY = + "Services/Doctors.svc/REST/PateintHasAppoimentHistory"; //URL to get patient appointment curfew history const GET_PATIENT_APPOINTMENT_CURFEW_HISTORY = @@ -264,13 +272,18 @@ const SEND_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT = const CHECK_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT = 'Services/Authentication.svc/REST/CheckActivationCodeForAdvancePayment'; +const GET_COVID_DRIVETHRU_PROJECT_LIST = + 'Services/Doctors.svc/REST/COVID19_ProjectDriveThroughTestingCenter'; -const GET_COVID_DRIVETHRU_PROJECT_LIST = 'Services/Doctors.svc/REST/COVID19_ProjectDriveThroughTestingCenter'; - -const GET_COVID_DRIVETHRU_PAYMENT_INFO = 'Services/Doctors.svc/REST/COVID19_GetPatientPaymentInormation'; +const GET_COVID_DRIVETHRU_PAYMENT_INFO = + 'Services/Doctors.svc/REST/COVID19_GetPatientPaymentInormation'; -const GET_COVID_DRIVETHRU_FREE_SLOTS = 'Services/Doctors.svc/REST/COVID19_GetFreeSlots'; +const GET_COVID_DRIVETHRU_FREE_SLOTS = + 'Services/Doctors.svc/REST/COVID19_GetFreeSlots'; +///Smartwatch Integration Services +const GET_PATIENT_LAST_RECORD = + 'Services/Patients.svc/REST/Med_GetPatientLastRecord'; ///My Trackers const GET_DIABETIC_RESULT_AVERAGE = @@ -312,7 +325,6 @@ const H2O_GET_USER_PROGRESS = "Services/H2ORemainder.svc/REST/H2O_GetUserProgress"; const H2O_INSERT_USER_ACTIVITY = "Services/H2ORemainder.svc/REST/H2O_InsertUserActivity"; - //E_Referral Services const GET_ALL_RELATIONSHIP_TYPES = @@ -325,18 +337,42 @@ 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/"; +// const GET_WISHLIST = "http://swd-pharapp-01:7200/api/shopping_cart_items/"; //Pharmacy address -const GET_ADDRESS = "https://uat.hmgwebservices.com/epharmacy/api/Customers/272843?fields=addresses"; +const GET_ADDRESS = + "https://uat.hmgwebservices.com/epharmacy/api/Customers/272843?fields=addresses"; //order + order details 'orders?customer=1,fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc&page=' + page_id + '&limit=200&customer_id='+ custmerId, -const GET_ORDER = "https://uat.hmgwebservices.com/epharmacy/api/orders?customer=1,fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc&page=1&limit=200&customer_id=1367368"; -const GET_ORDER_DETAILS = "https://uat.hmgwebservices.com/epharmacy/api/orders/3584"; +const GET_ORDER = + "https://uat.hmgwebservices.com/epharmacy/api/orders?customer=1,fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc&page=1&limit=200&customer_id=1367368"; +const GET_ORDER_DETAILS = + "https://uat.hmgwebservices.com/epharmacy/api/orders/3584"; +// pharmacy +const GET_PHARMACY_BANNER = "epharmacy/api/promotionbanners"; +const GET_PHARMACY_TOP_MANUFACTURER = "epharmacy/api/topmanufacturer"; +const GET_PHARMACY_BEST_SELLER_PRODUCT = "epharmacy/api/bestsellerproducts"; +const GET_PHARMACY_PRODUCTs_BY_IDS = "epharmacy/api/productsbyids/"; +const GET_CUSTOMERS_ADDRESSES = "epharmacy/api/Customers/"; +const GET_WISHLIST = "epharmacy/api/shopping_cart_items/"; + +// Home Health Care +const HHC_GET_ALL_SERVICES = + "Services/Patients.svc/REST/PatientER_HHC_GetAllServices"; +const HHC_GET_ALL_CMC_SERVICES = + "Services/Patients.svc/REST/PatientER_CMC_GetAllServices"; +const PATIENT_ER_UPDATE_PRES_ORDER = + "Services/Patients.svc/REST/PatientER_UpdatePresOrder"; +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 TIMER_MIN = 10; +const GOOGLE_API_KEY = "AIzaSyCmevVlr2Bh-c8W1VUzo8gt8JRY7n5PANw"; + class AppGlobal { static var context; @@ -361,4 +397,4 @@ class AppGlobal { return request; } -} \ No newline at end of file +} diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 0440addb..437bab38 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -344,7 +344,7 @@ const Map> localizedValues = { "en": "Home Health Care Service", 'ar': 'الرعاية الصحية المنزلية' }, - "OnlinePharmacy": {"en": "Online Pharmacy", 'ar': 'صيدلايات الحبيب'}, + "OnlinePharmacy": {"en": "Online Pharmacy", 'ar': 'صيدليات الحبيب'}, "EmergencyService": {"en": "Emergency Service", 'ar': 'الفحص الطبي الشامل'}, "OnlinePaymentService": { "en": "Online Payment Service", @@ -595,6 +595,19 @@ const Map> localizedValues = { "en": "Service Information", "ar": "معلومات الخدمة" }, + "ServiceInformation": {"en": "Service Information", "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.", + "ar": + "توفر هذه الخدمة مجموعه من خدمات الرعايه الصحيه المنزلية و متابعه مستمره وشامله للذين لا يستطيعون الوصول للمنشات الصحيه في اماكن اقامتهم (التحاليل المخبرية – الاشعة – التطعيمات – العلاج الطبيعي)... " + }, + "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.", @@ -611,8 +624,8 @@ const Map> localizedValues = { "lakum": {"en": "Lakum", "ar": "لكم"}, "wishlist": {"en": "Wishlist", "ar": "الرغبات"}, "reviews": {"en": "Reviews", "ar": "التقيمات"}, - "myPrescriptions": {"en": "My Prescriptions", "ar": "وصفاتي"}, - "medicationRefill": {"en": "Medication Refill", "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": "الوصول لنا"}, @@ -629,10 +642,19 @@ const Map> localizedValues = { "cancelled": {"en": "Cancelled", "ar": " ملغي"}, "writeReview": {"en": "Write Review", "ar": " اكتب تقييمك"}, "shareReview": {"en": "SHARE REVIEW", "ar": " اكتب تقييمك"}, - "backMyAccount": {"en": "BACK TO MY ACCOUNT ", "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": " تقييمك سوف يساعد الأخرين في اختيار المنتج الأفضل"}, + "reviewShared": { + "en": "Your review has been shared on product review section", + "ar": " تمت مشاركة تقييمك في قسم تقييم المنتج" + }, + "reviewComment": { + "en": "Your reviews help other to choose better product", + "ar": " تقييمك سوف يساعد الأخرين في اختيار المنتج الأفضل" + }, "shippingAddress": {"en": "SHIPPING ADDRESS", "ar": " عنوان الشحن"}, "shippedMethod": {"en": "SHIP BY:", "ar": " الشحن بواسطة:"}, "orderDetail": {"en": "Order Detail", "ar": " تفاصيل الطلب"}, @@ -646,7 +668,76 @@ const Map> localizedValues = { "cancelOrder": {"en": "CANCEL ORDER", "ar": "الغاء الطلب "}, "confirmAddress": {"en": "CONFIRM ADDRESS ", "ar": " تأكيد العنوان "}, "confirmLocation": {"en": "CONFIRM LOCATION ", "ar": " تأكيد الموقع "}, - "confirmDeleteMsg": {"en": "Are you sure! want to delete ", "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": "هل انت متأكد تريد حذف هذا المنتج "}, + "confirmCancellation": { + "en": "Are you sure! want to cancel this order ", + "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": "المعلومات التي تقدمها لا تتم مشاركتها مع أي شخص" + }, + "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": "الفحص ليس تشخيص." + }, + "remeberthat": {"en": "Remember that", "ar": "تذكر ذلك:"}, + + // pharmacy module + "medicationRefill": {"en": "MEDICATION REFILL", "ar": "إعادة تعبئة الدواء"}, + "offersAndPromotions": { + "en": "OFFERS & SPECIAL PROMOTIONS", + "ar": "العروض والترقيات الخاصة" + }, + "myPrescriptions": {"en": "MY PRESCRIPTIONS", "ar": "وصفاتي"}, + "searchAndScanMedication": { + "en": "SEARCH & SCAN FOR MEDICATION", + "ar": "البحث والمسح للأدوية" + }, + "shopByBrands": {"en": "Shop By Brands", "ar": "تسوق حسب الماركات"}, + "recentlyViewed": {"en": "Recently Viewed", "ar": "شوهدت مؤخرا"}, + "bestSellers": {"en": "Best Sellers", "ar": "أفضل البائعين"}, + "deleteAllItems": {"en": "Delete All Items", "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": "اسحب لتغيير عمرك" + }, }; diff --git a/lib/config/shared_pref_kay.dart b/lib/config/shared_pref_kay.dart index 7422052d..c5fafe03 100644 --- a/lib/config/shared_pref_kay.dart +++ b/lib/config/shared_pref_kay.dart @@ -16,3 +16,4 @@ const USER_LONG = 'user-long'; const IS_GO_TO_PARKING = 'IS_GO_TO_PARKING'; const IS_SEARCH_APPO = 'is-search-appo'; const IS_LIVECARE_APPOINTMENT = 'is_livecare_appointment'; +const PHARMACY_LAST_VISITED_PRODUCTS = 'last-visited'; diff --git a/lib/core/enum/OrderService.dart b/lib/core/enum/OrderService.dart index e6ce24eb..833e0919 100644 --- a/lib/core/enum/OrderService.dart +++ b/lib/core/enum/OrderService.dart @@ -1,4 +1,4 @@ -enum OrderService { AMBULANCE } +enum OrderService { AMBULANCE,HOME_HEALTH_CARE,Comprehensive_Medical_Checkup } extension SelectedOrderService on OrderService { int getIdOrderService() { @@ -6,6 +6,13 @@ extension SelectedOrderService on OrderService { case OrderService.AMBULANCE: return 4; break; + case OrderService.Comprehensive_Medical_Checkup: + return 3; + break; + case OrderService.HOME_HEALTH_CARE: + return 2; + break; + } return 4; } @@ -15,6 +22,12 @@ extension SelectedOrderService on OrderService { case 4: return OrderService.AMBULANCE; break; + case 2: + return OrderService.HOME_HEALTH_CARE; + break; + case 3: + return OrderService.Comprehensive_Medical_Checkup; + break; } return OrderService.AMBULANCE; diff --git a/lib/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_get_items_request_model.dart b/lib/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_get_items_request_model.dart new file mode 100644 index 00000000..6880f9f5 --- /dev/null +++ b/lib/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_get_items_request_model.dart @@ -0,0 +1,68 @@ +class CMCGetItemsRequestModel { + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + int patientTypeID; + int patientType; + int checkupType; + + CMCGetItemsRequestModel( + {this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType, + this.checkupType}); + + CMCGetItemsRequestModel.fromJson(Map json) { + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + patientID = json['PatientID']; + tokenID = json['TokenID']; + patientTypeID = json['PatientTypeID']; + patientType = json['PatientType']; + checkupType = json['CheckupType']; + } + + Map toJson() { + final Map data = new Map(); + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['PatientID'] = this.patientID; + data['TokenID'] = this.tokenID; + data['PatientTypeID'] = this.patientTypeID; + data['PatientType'] = this.patientType; + data['CheckupType'] = this.checkupType; + return data; + } +} diff --git a/lib/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_get_items_response_model.dart b/lib/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_get_items_response_model.dart new file mode 100644 index 00000000..6f362baa --- /dev/null +++ b/lib/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_get_items_response_model.dart @@ -0,0 +1,18 @@ +class CMCGetItemsResponseModel { + String itemDescription; + String itemName; + + CMCGetItemsResponseModel({this.itemDescription, this.itemName}); + + CMCGetItemsResponseModel.fromJson(Map json) { + itemDescription = json['ItemDescription']; + itemName = json['ItemName']; + } + + Map toJson() { + final Map data = new Map(); + data['ItemDescription'] = this.itemDescription; + data['ItemName'] = this.itemName; + return data; + } +} diff --git a/lib/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart b/lib/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart new file mode 100644 index 00000000..534988a7 --- /dev/null +++ b/lib/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart @@ -0,0 +1,135 @@ +class CMCInsertPresOrderRequestModel { + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + int patientTypeID; + int patientType; + double latitude; + double longitude; + int createdBy; + int orderServiceID; + List patientERCMCInsertServicesList; + + CMCInsertPresOrderRequestModel( + {this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType, + this.latitude, + this.longitude, + this.createdBy, + this.orderServiceID, + this.patientERCMCInsertServicesList}); + + CMCInsertPresOrderRequestModel.fromJson(Map json) { + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + patientID = json['PatientID']; + tokenID = json['TokenID']; + patientTypeID = json['PatientTypeID']; + patientType = json['PatientType']; + latitude = json['Latitude']; + longitude = json['Longitude']; + createdBy = json['CreatedBy']; + orderServiceID = json['OrderServiceID']; + if (json['PatientER_CMC_InsertServicesList'] != null) { + patientERCMCInsertServicesList = + new List(); + json['PatientER_CMC_InsertServicesList'].forEach((v) { + patientERCMCInsertServicesList + .add(new PatientERCMCInsertServicesList.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = new Map(); + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['PatientID'] = this.patientID; + data['TokenID'] = this.tokenID; + data['PatientTypeID'] = this.patientTypeID; + data['PatientType'] = this.patientType; + data['Latitude'] = this.latitude; + data['Longitude'] = this.longitude; + data['CreatedBy'] = this.createdBy; + data['OrderServiceID'] = this.orderServiceID; + if (this.patientERCMCInsertServicesList != null) { + data['PatientER_CMC_InsertServicesList'] = + this.patientERCMCInsertServicesList.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class PatientERCMCInsertServicesList { + int recordID; + String serviceID; + String selectedServiceName; + String selectedServiceNameAR; + dynamic price; + dynamic vAT; + dynamic totalPrice; + + PatientERCMCInsertServicesList( + {this.recordID, + this.serviceID, + this.selectedServiceName, + this.selectedServiceNameAR, + this.price, + this.vAT, + this.totalPrice}); + + PatientERCMCInsertServicesList.fromJson(Map json) { + recordID = json['RecordID']; + serviceID = json['ServiceID']; + selectedServiceName = json['selectedServiceName']; + selectedServiceNameAR = json['selectedServiceNameAR']; + price = json['Price']; + vAT = json['VAT']; + totalPrice = json['TotalPrice']; + } + + Map toJson() { + final Map data = new Map(); + data['RecordID'] = this.recordID; + data['ServiceID'] = this.serviceID; + data['selectedServiceName'] = this.selectedServiceName; + data['selectedServiceNameAR'] = this.selectedServiceNameAR; + data['Price'] = this.price; + data['VAT'] = this.vAT; + data['TotalPrice'] = this.totalPrice; + return data; + } +} diff --git a/lib/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/get_cmc_service_request_model.dart b/lib/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/get_cmc_service_request_model.dart new file mode 100644 index 00000000..e80b656d --- /dev/null +++ b/lib/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/get_cmc_service_request_model.dart @@ -0,0 +1,72 @@ +class GetCMCServicesRequestModel { + int channel; + int deviceTypeID; + int genderID; + String generalid; + String identificationNo; + String iPAdress; + bool isDentalAllowedBackend; + int languageID; + int patientID; + int patientOutSA; + int patientType; + int patientTypeID; + String sessionID; + String tokenID; + double versionID; + + GetCMCServicesRequestModel( + {this.channel, + this.deviceTypeID, + this.genderID, + this.generalid, + this.identificationNo, + this.iPAdress, + this.isDentalAllowedBackend, + this.languageID, + this.patientID, + this.patientOutSA, + this.patientType, + this.patientTypeID, + this.sessionID, + this.tokenID, + this.versionID}); + + GetCMCServicesRequestModel.fromJson(Map json) { + channel = json['Channel']; + deviceTypeID = json['DeviceTypeID']; + genderID = json['GenderID']; + generalid = json['generalid']; + identificationNo = json['IdentificationNo']; + iPAdress = json['IPAdress']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + languageID = json['LanguageID']; + patientID = json['PatientID']; + patientOutSA = json['PatientOutSA']; + patientType = json['PatientType']; + patientTypeID = json['PatientTypeID']; + sessionID = json['SessionID']; + tokenID = json['TokenID']; + versionID = json['VersionID']; + } + + Map toJson() { + final Map data = new Map(); + data['Channel'] = this.channel; + data['DeviceTypeID'] = this.deviceTypeID; + data['GenderID'] = this.genderID; + data['generalid'] = this.generalid; + data['IdentificationNo'] = this.identificationNo; + data['IPAdress'] = this.iPAdress; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['LanguageID'] = this.languageID; + data['PatientID'] = this.patientID; + data['PatientOutSA'] = this.patientOutSA; + data['PatientType'] = this.patientType; + data['PatientTypeID'] = this.patientTypeID; + data['SessionID'] = this.sessionID; + data['TokenID'] = this.tokenID; + data['VersionID'] = this.versionID; + return data; + } +} diff --git a/lib/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/get_cmc_service_response_model.dart b/lib/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/get_cmc_service_response_model.dart new file mode 100644 index 00000000..5f356e2b --- /dev/null +++ b/lib/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/get_cmc_service_response_model.dart @@ -0,0 +1,44 @@ +class GetCMCServicesResponseModel { + String description; + String descriptionN; + int iD; + bool isActive; + dynamic price; + int serviceID; + dynamic totalPrice; + dynamic vAT; + + GetCMCServicesResponseModel( + {this.description, + this.descriptionN, + this.iD, + this.isActive, + this.price, + this.serviceID, + this.totalPrice, + this.vAT}); + + GetCMCServicesResponseModel.fromJson(Map json) { + description = json['Description']; + descriptionN = json['DescriptionN']; + iD = json['ID']; + isActive = json['IsActive']; + price = json['Price']; + serviceID = json['ServiceID']; + totalPrice = json['TotalPrice']; + vAT = json['VAT']; + } + + Map toJson() { + final Map data = new Map(); + data['Description'] = this.description; + data['DescriptionN'] = this.descriptionN; + data['ID'] = this.iD; + data['IsActive'] = this.isActive; + data['Price'] = this.price; + data['ServiceID'] = this.serviceID; + data['TotalPrice'] = this.totalPrice; + data['VAT'] = this.vAT; + return data; + } +} diff --git a/lib/core/model/AlHabibMedicalService/insert_user_activity_request_model.dart b/lib/core/model/AlHabibMedicalService/H2O/insert_user_activity_request_model.dart similarity index 100% rename from lib/core/model/AlHabibMedicalService/insert_user_activity_request_model.dart rename to lib/core/model/AlHabibMedicalService/H2O/insert_user_activity_request_model.dart diff --git a/lib/core/model/AlHabibMedicalService/user_progress_for_month_data_model.dart b/lib/core/model/AlHabibMedicalService/H2O/user_progress_for_month_data_model.dart similarity index 100% rename from lib/core/model/AlHabibMedicalService/user_progress_for_month_data_model.dart rename to lib/core/model/AlHabibMedicalService/H2O/user_progress_for_month_data_model.dart diff --git a/lib/core/model/AlHabibMedicalService/user_progress_for_today_data_model.dart b/lib/core/model/AlHabibMedicalService/H2O/user_progress_for_today_data_model.dart similarity index 100% rename from lib/core/model/AlHabibMedicalService/user_progress_for_today_data_model.dart rename to lib/core/model/AlHabibMedicalService/H2O/user_progress_for_today_data_model.dart diff --git a/lib/core/model/AlHabibMedicalService/user_progress_for_week_data_model.dart b/lib/core/model/AlHabibMedicalService/H2O/user_progress_for_week_data_model.dart similarity index 100% rename from lib/core/model/AlHabibMedicalService/user_progress_for_week_data_model.dart rename to lib/core/model/AlHabibMedicalService/H2O/user_progress_for_week_data_model.dart diff --git a/lib/core/model/AlHabibMedicalService/user_progress_request_model.dart b/lib/core/model/AlHabibMedicalService/H2O/user_progress_request_model.dart similarity index 100% rename from lib/core/model/AlHabibMedicalService/user_progress_request_model.dart rename to lib/core/model/AlHabibMedicalService/H2O/user_progress_request_model.dart diff --git a/lib/core/model/AlHabibMedicalService/HomeHealthCare/HHC_get_all_services_request_modle.dart b/lib/core/model/AlHabibMedicalService/HomeHealthCare/HHC_get_all_services_request_modle.dart new file mode 100644 index 00000000..7b24c149 --- /dev/null +++ b/lib/core/model/AlHabibMedicalService/HomeHealthCare/HHC_get_all_services_request_modle.dart @@ -0,0 +1,64 @@ +class HHCGetAllServicesRequestModel { + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + int patientTypeID; + int patientType; + + HHCGetAllServicesRequestModel( + {this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType}); + + HHCGetAllServicesRequestModel.fromJson(Map json) { + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + patientID = json['PatientID']; + tokenID = json['TokenID']; + patientTypeID = json['PatientTypeID']; + patientType = json['PatientType']; + } + + Map toJson() { + final Map data = new Map(); + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['PatientID'] = this.patientID; + data['TokenID'] = this.tokenID; + data['PatientTypeID'] = this.patientTypeID; + data['PatientType'] = this.patientType; + return data; + } +} diff --git a/lib/core/model/AlHabibMedicalService/HomeHealthCare/HHC_get_all_services_response_model.dart b/lib/core/model/AlHabibMedicalService/HomeHealthCare/HHC_get_all_services_response_model.dart new file mode 100644 index 00000000..e2f39733 --- /dev/null +++ b/lib/core/model/AlHabibMedicalService/HomeHealthCare/HHC_get_all_services_response_model.dart @@ -0,0 +1,32 @@ +class HHCGetAllServicesResponseModel { + int iD; + int serviceID; + String description; + String descriptionN; + bool isActive; + + HHCGetAllServicesResponseModel( + {this.iD, + this.serviceID, + this.description, + this.descriptionN, + this.isActive}); + + HHCGetAllServicesResponseModel.fromJson(Map json) { + iD = json['ID']; + serviceID = json['ServiceID']; + description = json['Description']; + descriptionN = json['DescriptionN']; + isActive = json['IsActive']; + } + + Map toJson() { + final Map data = new Map(); + data['ID'] = this.iD; + data['ServiceID'] = this.serviceID; + data['Description'] = this.description; + data['DescriptionN'] = this.descriptionN; + data['IsActive'] = this.isActive; + return data; + } +} diff --git a/lib/core/model/AlHabibMedicalService/HomeHealthCare/PatientERHHCInsertServicesList.dart b/lib/core/model/AlHabibMedicalService/HomeHealthCare/PatientERHHCInsertServicesList.dart new file mode 100644 index 00000000..bc5a4ddf --- /dev/null +++ b/lib/core/model/AlHabibMedicalService/HomeHealthCare/PatientERHHCInsertServicesList.dart @@ -0,0 +1,23 @@ + +class PatientERHHCInsertServicesList { + int recordID; + int serviceID; + String serviceName; + + PatientERHHCInsertServicesList( + {this.recordID, this.serviceID, this.serviceName}); + + PatientERHHCInsertServicesList.fromJson(Map json) { + recordID = json['RecordID']; + serviceID = json['ServiceID']; + serviceName = json['ServiceName']; + } + + Map toJson() { + final Map data = new Map(); + data['RecordID'] = this.recordID; + data['ServiceID'] = this.serviceID; + data['ServiceName'] = this.serviceName; + return data; + } +} diff --git a/lib/core/model/AlHabibMedicalService/HomeHealthCare/get_hhc_all_pres_orders_request_model.dart b/lib/core/model/AlHabibMedicalService/HomeHealthCare/get_hhc_all_pres_orders_request_model.dart new file mode 100644 index 00000000..ed55b3a9 --- /dev/null +++ b/lib/core/model/AlHabibMedicalService/HomeHealthCare/get_hhc_all_pres_orders_request_model.dart @@ -0,0 +1,64 @@ +class GetHHCAllPresOrdersRequestModel { + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + int patientTypeID; + int patientType; + + GetHHCAllPresOrdersRequestModel( + {this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType}); + + GetHHCAllPresOrdersRequestModel.fromJson(Map json) { + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + patientID = json['PatientID']; + tokenID = json['TokenID']; + patientTypeID = json['PatientTypeID']; + patientType = json['PatientType']; + } + + Map toJson() { + final Map data = new Map(); + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['PatientID'] = this.patientID; + data['TokenID'] = this.tokenID; + data['PatientTypeID'] = this.patientTypeID; + data['PatientType'] = this.patientType; + return data; + } +} diff --git a/lib/core/model/AlHabibMedicalService/HomeHealthCare/get_hhc_all_pres_orders_response_model.dart b/lib/core/model/AlHabibMedicalService/HomeHealthCare/get_hhc_all_pres_orders_response_model.dart new file mode 100644 index 00000000..5dedac1c --- /dev/null +++ b/lib/core/model/AlHabibMedicalService/HomeHealthCare/get_hhc_all_pres_orders_response_model.dart @@ -0,0 +1,132 @@ +class GetHHCAllPresOrdersResponseModel { + int iD; + String patientID; + bool patientOutSA; + bool isOutPatient; + int projectID; + int nearestProjectID; + double longitude; + double latitude; + String appointmentNo; + String dischargeID; + int lineItemNo; + int status; + String description; + String descriptionN; + String createdOn; + int serviceID; + int createdBy; + String editedOn; + int editedBy; + int channel; + dynamic clientRequestID; + bool returnedToQueue; + dynamic pickupDateTime; + dynamic pickupLocationName; + dynamic dropoffLocationName; + int realRRTHaveTransactions; + String nearestProjectDescription; + String nearestProjectDescriptionN; + String projectDescription; + String projectDescriptionN; + + GetHHCAllPresOrdersResponseModel( + {this.iD, + this.patientID, + this.patientOutSA, + this.isOutPatient, + this.projectID, + this.nearestProjectID, + this.longitude, + this.latitude, + this.appointmentNo, + this.dischargeID, + this.lineItemNo, + this.status, + this.description, + this.descriptionN, + this.createdOn, + this.serviceID, + this.createdBy, + this.editedOn, + this.editedBy, + this.channel, + this.clientRequestID, + this.returnedToQueue, + this.pickupDateTime, + this.pickupLocationName, + this.dropoffLocationName, + this.realRRTHaveTransactions, + this.nearestProjectDescription, + this.nearestProjectDescriptionN, + this.projectDescription, + this.projectDescriptionN}); + + GetHHCAllPresOrdersResponseModel.fromJson(Map json) { + iD = json['ID']; + patientID = json['PatientID']; + patientOutSA = json['PatientOutSA']; + isOutPatient = json['IsOutPatient']; + projectID = json['ProjectID']; + nearestProjectID = json['NearestProjectID']; + longitude = json['Longitude']; + latitude = json['Latitude']; + appointmentNo = json['AppointmentNo']; + dischargeID = json['DischargeID']; + lineItemNo = json['LineItemNo']; + status = json['Status']; + description = json['Description']; + descriptionN = json['DescriptionN']; + createdOn = json['CreatedOn']; + serviceID = json['ServiceID']; + createdBy = json['CreatedBy']; + editedOn = json['EditedOn']; + editedBy = json['EditedBy']; + channel = json['Channel']; + clientRequestID = json['ClientRequestID']; + returnedToQueue = json['ReturnedToQueue']; + pickupDateTime = json['PickupDateTime']; + pickupLocationName = json['PickupLocationName']; + dropoffLocationName = json['DropoffLocationName']; + realRRTHaveTransactions = json['RealRRT_HaveTransactions']; + nearestProjectDescription = json['NearestProjectDescription']; + nearestProjectDescriptionN = json['NearestProjectDescriptionN']; + projectDescription = json['ProjectDescription']; + projectDescriptionN = json['ProjectDescriptionN']; + } + + Map toJson() { + final Map data = new Map(); + data['ID'] = this.iD; + data['PatientID'] = this.patientID; + data['PatientOutSA'] = this.patientOutSA; + data['IsOutPatient'] = this.isOutPatient; + data['ProjectID'] = this.projectID; + data['NearestProjectID'] = this.nearestProjectID; + data['Longitude'] = this.longitude; + data['Latitude'] = this.latitude; + data['AppointmentNo'] = this.appointmentNo; + data['DischargeID'] = this.dischargeID; + data['LineItemNo'] = this.lineItemNo; + data['Status'] = this.status; + data['Description'] = this.description; + data['DescriptionN'] = this.descriptionN; + data['CreatedOn'] = this.createdOn; + data['ServiceID'] = this.serviceID; + data['CreatedBy'] = this.createdBy; + data['EditedOn'] = this.editedOn; + data['EditedBy'] = this.editedBy; + data['Channel'] = this.channel; + data['ClientRequestID'] = this.clientRequestID; + data['ReturnedToQueue'] = this.returnedToQueue; + data['PickupDateTime'] = this.pickupDateTime; + data['PickupLocationName'] = this.pickupLocationName; + data['DropoffLocationName'] = this.dropoffLocationName; + data['RealRRT_HaveTransactions'] = this.realRRTHaveTransactions; + data['NearestProjectDescription'] = this.nearestProjectDescription; + data['NearestProjectDescriptionN'] = this.nearestProjectDescriptionN; + data['ProjectDescription'] = this.projectDescription; + data['ProjectDescriptionN'] = this.projectDescriptionN; + return data; + } +} diff --git a/lib/core/model/AlHabibMedicalService/HomeHealthCare/get_order_detail_by_order_iD_request_model.dart b/lib/core/model/AlHabibMedicalService/HomeHealthCare/get_order_detail_by_order_iD_request_model.dart new file mode 100644 index 00000000..04b69b98 --- /dev/null +++ b/lib/core/model/AlHabibMedicalService/HomeHealthCare/get_order_detail_by_order_iD_request_model.dart @@ -0,0 +1,68 @@ +class GetOrderDetailByOrderIDRequestModel { + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + int patientTypeID; + int patientType; + int presOrderID; + + GetOrderDetailByOrderIDRequestModel( + {this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType, + this.presOrderID}); + + GetOrderDetailByOrderIDRequestModel.fromJson(Map json) { + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + patientID = json['PatientID']; + tokenID = json['TokenID']; + patientTypeID = json['PatientTypeID']; + patientType = json['PatientType']; + presOrderID = json['PresOrderID']; + } + + Map toJson() { + final Map data = new Map(); + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['PatientID'] = this.patientID; + data['TokenID'] = this.tokenID; + data['PatientTypeID'] = this.patientTypeID; + data['PatientType'] = this.patientType; + data['PresOrderID'] = this.presOrderID; + return data; + } +} diff --git a/lib/core/model/AlHabibMedicalService/HomeHealthCare/get_order_detail_by_order_iD_response_model.dart b/lib/core/model/AlHabibMedicalService/HomeHealthCare/get_order_detail_by_order_iD_response_model.dart new file mode 100644 index 00000000..6fc31ce8 --- /dev/null +++ b/lib/core/model/AlHabibMedicalService/HomeHealthCare/get_order_detail_by_order_iD_response_model.dart @@ -0,0 +1,52 @@ +class GetOrderDetailByOrderIDResponseModel { + int iD; + int presOrderID; + int hHCServiceID; + int createdBy; + String createdOn; + int editedBy; + String editedOn; + bool isActive; + String description; + String descriptionN; + + GetOrderDetailByOrderIDResponseModel( + {this.iD, + this.presOrderID, + this.hHCServiceID, + this.createdBy, + this.createdOn, + this.editedBy, + this.editedOn, + this.isActive, + this.description, + this.descriptionN}); + + GetOrderDetailByOrderIDResponseModel.fromJson(Map json) { + iD = json['ID']; + presOrderID = json['PresOrderID']; + hHCServiceID = json['HHC_ServiceID']; + createdBy = json['CreatedBy']; + createdOn = json['CreatedOn']; + editedBy = json['EditedBy']; + editedOn = json['EditedOn']; + isActive = json['IsActive']; + description = json['Description']; + descriptionN = json['DescriptionN']; + } + + Map toJson() { + final Map data = new Map(); + data['ID'] = this.iD; + data['PresOrderID'] = this.presOrderID; + data['HHC_ServiceID'] = this.hHCServiceID; + data['CreatedBy'] = this.createdBy; + data['CreatedOn'] = this.createdOn; + data['EditedBy'] = this.editedBy; + data['EditedOn'] = this.editedOn; + data['IsActive'] = this.isActive; + data['Description'] = this.description; + data['DescriptionN'] = this.descriptionN; + return data; + } +} diff --git a/lib/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart b/lib/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart new file mode 100644 index 00000000..6987ee44 --- /dev/null +++ b/lib/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart @@ -0,0 +1,97 @@ +import 'PatientERHHCInsertServicesList.dart'; + +class PatientERInsertPresOrderRequestModel { + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + int patientTypeID; + int patientType; + double latitude; + double longitude; + int createdBy; + int orderServiceID; + List patientERHHCInsertServicesList = List(); + + PatientERInsertPresOrderRequestModel( + {this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType, + this.latitude, + this.longitude, + this.createdBy, + this.orderServiceID, + this.patientERHHCInsertServicesList + }); + + PatientERInsertPresOrderRequestModel.fromJson(Map json) { + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + patientID = json['PatientID']; + tokenID = json['TokenID']; + patientTypeID = json['PatientTypeID']; + patientType = json['PatientType']; + latitude = json['Latitude']; + longitude = json['Longitude']; + createdBy = json['CreatedBy']; + orderServiceID = json['OrderServiceID']; + if (json['PatientER_HHC_InsertServicesList'] != null) { + patientERHHCInsertServicesList = + new List(); + json['PatientER_HHC_InsertServicesList'].forEach((v) { + patientERHHCInsertServicesList + .add(new PatientERHHCInsertServicesList.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = new Map(); + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['PatientID'] = this.patientID; + data['TokenID'] = this.tokenID; + data['PatientTypeID'] = this.patientTypeID; + data['PatientType'] = this.patientType; + data['Latitude'] = this.latitude; + data['Longitude'] = this.longitude; + data['CreatedBy'] = this.createdBy; + data['OrderServiceID'] = this.orderServiceID; + if (this.patientERHHCInsertServicesList != null) { + data['PatientER_HHC_InsertServicesList'] = + this.patientERHHCInsertServicesList.map((v) => v.toJson()).toList(); + } + return data; + } +} diff --git a/lib/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart b/lib/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart new file mode 100644 index 00000000..3b0ef151 --- /dev/null +++ b/lib/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart @@ -0,0 +1,80 @@ +class UpdatePresOrderRequestModel { + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + int patientTypeID; + int patientType; + int presOrderID; + int presOrderStatus; + int editedBy; + String rejectionReason; + + UpdatePresOrderRequestModel( + {this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType, + this.presOrderID, + this.presOrderStatus, + this.editedBy, + this.rejectionReason}); + + UpdatePresOrderRequestModel.fromJson(Map json) { + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + patientID = json['PatientID']; + tokenID = json['TokenID']; + patientTypeID = json['PatientTypeID']; + patientType = json['PatientType']; + presOrderID = json['PresOrderID']; + presOrderStatus = json['PresOrderStatus']; + editedBy = json['EditedBy']; + rejectionReason = json['RejectionReason']; + } + + Map toJson() { + final Map data = new Map(); + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['PatientID'] = this.patientID; + data['TokenID'] = this.tokenID; + data['PatientTypeID'] = this.patientTypeID; + data['PatientType'] = this.patientType; + data['PresOrderID'] = this.presOrderID; + data['PresOrderStatus'] = this.presOrderStatus; + data['EditedBy'] = this.editedBy; + data['RejectionReason'] = this.rejectionReason; + return data; + } +} diff --git a/lib/core/model/er/PatientER.dart b/lib/core/model/er/PatientER.dart index d0827311..f1694f9e 100644 --- a/lib/core/model/er/PatientER.dart +++ b/lib/core/model/er/PatientER.dart @@ -36,7 +36,7 @@ class PatientER { int projectID; int createdBy; int lineItemNo; - int cost; + double cost; double vAT; double totalPrice; String pickupLocationLattitude; diff --git a/lib/core/model/er/PickUpRequestPresOrder.dart b/lib/core/model/er/PickUpRequestPresOrder.dart index 9ce3e678..376e30ae 100644 --- a/lib/core/model/er/PickUpRequestPresOrder.dart +++ b/lib/core/model/er/PickUpRequestPresOrder.dart @@ -18,7 +18,7 @@ class PickUpRequestPresOrder { int pickupSpot; dynamic dropoffLocationId; int transportationMethodId; - int cost; + double cost; double vAT; double totalPrice; int amountCollected; diff --git a/lib/core/model/pharmacies/Addresses.dart b/lib/core/model/pharmacies/Addresses.dart new file mode 100644 index 00000000..74d5a591 --- /dev/null +++ b/lib/core/model/pharmacies/Addresses.dart @@ -0,0 +1,85 @@ +class Addresses { + 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; + + 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/model/pharmacies/Customer.dart b/lib/core/model/pharmacies/Customer.dart new file mode 100644 index 00000000..a5311489 --- /dev/null +++ b/lib/core/model/pharmacies/Customer.dart @@ -0,0 +1,128 @@ +class Customer { + String fileNumber; + String iqamaNumber; + int isOutSa; + int patientType; + String gender; + String birthDate; + String phone; + String countryCode; + String yahalaAccountno; + String billingAddress; + String shippingAddress; + String id; + String username; + String email; + String firstName; + String lastName; + String languageId; + String adminComment; + String isTaxExempt; + String hasShoppingCartItems; + String active; + String deleted; + String isSystemAccount; + String systemName; + String lastIpAddress; + String createdOnUtc; + String lastLoginDateUtc; + String lastActivityDateUtc; + String 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}); + + Customer.fromJson(Map json) { + fileNumber = json['file_number']; + iqamaNumber = json['iqama_number']; + isOutSa = json['is_out_sa']; + patientType = json['patient_type']; + gender = json['gender']; + birthDate = 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 = 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 = json['created_on_utc']; + lastLoginDateUtc = json['last_login_date_utc']; + lastActivityDateUtc = json['last_activity_date_utc']; + registeredInStoreId = json['registered_in_store_id']; + } + + Map toJson() { + final Map data = new Map(); + data['file_number'] = this.fileNumber; + data['iqama_number'] = this.iqamaNumber; + data['is_out_sa'] = this.isOutSa; + data['patient_type'] = this.patientType; + data['gender'] = this.gender; + data['birth_date'] = this.birthDate; + 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; + data['first_name'] = this.firstName; + data['last_name'] = this.lastName; + data['language_id'] = this.languageId; + data['admin_comment'] = this.adminComment; + data['is_tax_exempt'] = this.isTaxExempt; + data['has_shopping_cart_items'] = this.hasShoppingCartItems; + data['active'] = this.active; + data['deleted'] = this.deleted; + data['is_system_account'] = this.isSystemAccount; + data['system_name'] = this.systemName; + data['last_ip_address'] = this.lastIpAddress; + data['created_on_utc'] = this.createdOnUtc; + data['last_login_date_utc'] = this.lastLoginDateUtc; + data['last_activity_date_utc'] = this.lastActivityDateUtc; + data['registered_in_store_id'] = this.registeredInStoreId; + return data; + } +} \ No newline at end of file diff --git a/lib/core/model/pharmacies/Manufacturer.dart b/lib/core/model/pharmacies/Manufacturer.dart new file mode 100644 index 00000000..3b16337b --- /dev/null +++ b/lib/core/model/pharmacies/Manufacturer.dart @@ -0,0 +1,98 @@ +import 'PharmacyImageObject.dart'; + +class Manufacturer { + String id; + String name; + String namen; + // List localizedNames; + String description; + int manufacturerTemplateId; + String metaKeywords; + String metaDescription; + String metaTitle; + int pageSize; + String pageSizeOptions; + String priceRanges; + bool published; + bool deleted; + int displayOrder; + String createdOnUtc; + String updatedOnUtc; + PharmacyImageObject image; + + Manufacturer( + {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}); + + Manufacturer.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']; + 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 = json['created_on_utc']; + updatedOnUtc = json['updated_on_utc']; + image = json['image'] != null + ? new PharmacyImageObject.fromJson(json['image']) + : null; + } + + 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['manufacturer_template_id'] = this.manufacturerTemplateId; + data['meta_keywords'] = this.metaKeywords; + data['meta_description'] = this.metaDescription; + data['meta_title'] = this.metaTitle; + data['page_size'] = this.pageSize; + data['page_size_options'] = this.pageSizeOptions; + data['price_ranges'] = this.priceRanges; + 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.image != null) { + data['image'] = this.image.toJson(); + } + return data; + } +} diff --git a/lib/core/model/pharmacies/PharmacyImageObject.dart b/lib/core/model/pharmacies/PharmacyImageObject.dart new file mode 100644 index 00000000..d3db634b --- /dev/null +++ b/lib/core/model/pharmacies/PharmacyImageObject.dart @@ -0,0 +1,27 @@ +class PharmacyImageObject { + int id; + int position; + String src; + String thumb; + String attachment; + + PharmacyImageObject({this.id, this.position, this.src, this.thumb, this.attachment}); + + PharmacyImageObject.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/pharmacies/PharmacyProduct.dart b/lib/core/model/pharmacies/PharmacyProduct.dart new file mode 100644 index 00000000..cd461ae5 --- /dev/null +++ b/lib/core/model/pharmacies/PharmacyProduct.dart @@ -0,0 +1,149 @@ +import 'PharmacyImageObject.dart'; +import 'Reviews.dart'; + +class PharmacyProduct { + String id; + String name; + String namen; + String shortDescription; + String fullDescription; + String fullDescriptionn; + int approvedRatingSum; + int approvedTotalReviews; + String sku; + bool isRx; + String rxMessage; + String rxMessagen; + int stockQuantity; + String stockAvailability; + String stockAvailabilityn; + bool allowBackInStockSubscriptions; + int orderMinimumQuantity; + int orderMaximumQuantity; + double price; + double oldPrice; + String discountName; + String discountNamen; + String discountPercentage; + int displayOrder; + List discountIds; + List reviews; + List images; + + PharmacyProduct( + {this.id, + this.name, + this.namen, + 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}); + + 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); + } + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['name'] = this.name; + data['namen'] = this.namen; + 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.discountIds != String) { + data['discount_ids'] = this.discountIds.map((v) => v).toList(); + } + if (this.reviews != String) { + data['reviews'] = this.reviews.map((v) => v.toJson()).toList(); + } + if (this.images != String) { + data['images'] = this.images.map((v) => v.toJson()).toList(); + } + return data; + } +} diff --git a/lib/core/model/pharmacies/Reviews.dart b/lib/core/model/pharmacies/Reviews.dart new file mode 100644 index 00000000..f924dce3 --- /dev/null +++ b/lib/core/model/pharmacies/Reviews.dart @@ -0,0 +1,82 @@ +import '../pharmacies/Customer.dart'; + +class Reviews { + int id; + int position; + int reviewId; + int customerId; + int productId; + int storeId; + bool isApproved; + String title; + String reviewText; + Null replyText; + int rating; + int helpfulYesTotal; + int helpfulNoTotal; + String createdOnUtc; + Customer customer; + Null product; + + Reviews( + {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}); + + Reviews.fromJson(Map json) { + 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 = json['created_on_utc']; + customer = json['customer'] != null + ? new Customer.fromJson(json['customer']) + : null; + product = json['product']; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['position'] = this.position; + data['review_id'] = this.reviewId; + data['customer_id'] = this.customerId; + data['product_id'] = this.productId; + data['store_id'] = this.storeId; + data['is_approved'] = this.isApproved; + data['title'] = this.title; + data['review_text'] = this.reviewText; + data['reply_text'] = this.replyText; + data['rating'] = this.rating; + data['helpful_yes_total'] = this.helpfulYesTotal; + data['helpful_no_total'] = this.helpfulNoTotal; + data['created_on_utc'] = this.createdOnUtc; + if (this.customer != null) { + data['customer'] = this.customer.toJson(); + } + data['product'] = this.product; + return data; + } +} \ No newline at end of file diff --git a/lib/core/service/AlHabibMedicalService/H2O_service.dart b/lib/core/service/AlHabibMedicalService/H2O_service.dart index d44b50ef..c65221c5 100644 --- a/lib/core/service/AlHabibMedicalService/H2O_service.dart +++ b/lib/core/service/AlHabibMedicalService/H2O_service.dart @@ -1,9 +1,9 @@ import 'package:diplomaticquarterapp/config/config.dart'; -import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/insert_user_activity_request_model.dart'; -import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/user_progress_for_month_data_model.dart'; -import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/user_progress_for_today_data_model.dart'; -import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/user_progress_for_week_data_model.dart'; -import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/user_progress_request_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/insert_user_activity_request_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/user_progress_for_month_data_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/user_progress_for_today_data_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/user_progress_for_week_data_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/user_progress_request_model.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart'; class H2OService extends BaseService { diff --git a/lib/core/service/AlHabibMedicalService/cmc_service.dart b/lib/core/service/AlHabibMedicalService/cmc_service.dart new file mode 100644 index 00000000..dffa6683 --- /dev/null +++ b/lib/core/service/AlHabibMedicalService/cmc_service.dart @@ -0,0 +1,115 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_get_items_request_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_get_items_response_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/get_cmc_service_request_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/get_cmc_service_response_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_hHC_all_pres_orders_request_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_hhc_all_pres_orders_response_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_order_detail_by_order_iD_request_model.dart'; +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 '../base_service.dart'; + +class CMCService extends BaseService { + List cmcAllServicesList = List(); + List cmcAllPresOrdersList = List(); + + List cmcAllOrderDetail = List(); + List checkupItemsList = List(); + + bool isOrderUpdated; + + Future getCMCAllServices() async { + + + GetCMCServicesRequestModel getCMCServicesRequestModel= new GetCMCServicesRequestModel(genderID: user.gender, identificationNo: user.patientIdentificationNo); + hasError = false; + await baseAppClient.post(HHC_GET_ALL_CMC_SERVICES, + onSuccess: (dynamic response, int statusCode) { + cmcAllServicesList.clear(); + response['PatientER_CMC_GetAllServicesList'].forEach((data) { + cmcAllServicesList.add(GetCMCServicesResponseModel.fromJson(data)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: getCMCServicesRequestModel.toJson()); + } + + + + Future getCmcAllPresOrders() async { + + GetHHCAllPresOrdersRequestModel getHHCAllPresOrdersRequestModel= GetHHCAllPresOrdersRequestModel(); + hasError = false; + await baseAppClient.post(GET_PATIENT_ALL_PRES_ORDERS, + onSuccess: (dynamic response, int statusCode) { + cmcAllPresOrdersList.clear(); + response['PatientER_GetPatientAllPresOrdersList'].forEach((data) { + if (data['ServiceID'] == 3) + cmcAllPresOrdersList + .add(GetHHCAllPresOrdersResponseModel.fromJson(data)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: getHHCAllPresOrdersRequestModel.toJson()); + } + + Future getOrderDetailByOrderID(GetOrderDetailByOrderIDRequestModel getOrderDetailByOrderIDRequestModel) async { + + hasError = false; + await baseAppClient.post(GET_CMC_ORDER_DETAIL_BY_ID, + onSuccess: (dynamic response, int statusCode) { + cmcAllOrderDetail.clear(); + response['PatientER_CMC_GetTransactionsForOrderList'].forEach((data) { + cmcAllOrderDetail.add(GetOrderDetailByOrderIDResponseModel.fromJson(data)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: getOrderDetailByOrderIDRequestModel.toJson()); + } + + + Future getCheckupItems(CMCGetItemsRequestModel cMCGetItemsRequestModel) async { + + hasError = false; + await baseAppClient.post(GET_CHECK_UP_ITEMS, + onSuccess: (dynamic response, int statusCode) { + checkupItemsList.clear(); + response['GetCheckUpItemsList'].forEach((data) { + checkupItemsList.add(CMCGetItemsResponseModel.fromJson(data)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: cMCGetItemsRequestModel.toJson()); + } + + Future updateCmcPresOrder(UpdatePresOrderRequestModel updatePresOrderRequestModel) async { + + hasError = false; + await baseAppClient.post(PATIENT_ER_UPDATE_PRES_ORDER, + onSuccess: (dynamic response, int statusCode) { + isOrderUpdated = true; + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: updatePresOrderRequestModel.toJson()); + } + + Future insertPresPresOrder({CMCInsertPresOrderRequestModel order}) async { + + hasError = false; + await baseAppClient.post(PATIENT_ER_UPDATE_PRES_ORDER, + onSuccess: (dynamic response, int statusCode) { + isOrderUpdated = true; + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: order.toJson()); + } +} diff --git a/lib/core/service/AlHabibMedicalService/home_health_care_service.dart b/lib/core/service/AlHabibMedicalService/home_health_care_service.dart new file mode 100644 index 00000000..e636321b --- /dev/null +++ b/lib/core/service/AlHabibMedicalService/home_health_care_service.dart @@ -0,0 +1,93 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/HHC_get_all_services_request_modle.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/HHC_get_all_services_response_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_hHC_all_pres_orders_request_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_hhc_all_pres_orders_response_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_order_detail_by_order_iD_request_model.dart'; +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 '../base_service.dart'; + +class HomeHealthCareService extends BaseService { + List hhcAllServicesList = List(); + List hhcAllPresOrdersList = List(); + + List hhcAllOrderDetail = List(); + + bool isOrderUpdated; + + Future getHHCAllServices( + HHCGetAllServicesRequestModel hHCGetAllServicesRequestModel) async { + hasError = false; + await baseAppClient.post(HHC_GET_ALL_SERVICES, + onSuccess: (dynamic response, int statusCode) { + hhcAllServicesList.clear(); + response['PatientER_HHC_GetAllServicesList'].forEach((data) { + hhcAllServicesList.add(HHCGetAllServicesResponseModel.fromJson(data)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: hHCGetAllServicesRequestModel.toJson()); + } + + Future getHHCAllPresOrders() async { + GetHHCAllPresOrdersRequestModel getHHCAllPresOrdersRequestModel = + GetHHCAllPresOrdersRequestModel(); + hasError = false; + await baseAppClient.post(GET_PATIENT_ALL_PRES_ORDERS, + onSuccess: (dynamic response, int statusCode) { + hhcAllPresOrdersList.clear(); + response['PatientER_GetPatientAllPresOrdersList'].forEach((data) { + if (data['ServiceID'] == 2) + hhcAllPresOrdersList + .add(GetHHCAllPresOrdersResponseModel.fromJson(data)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: getHHCAllPresOrdersRequestModel.toJson()); + } + + Future getOrderDetailByOrderID(int presOrderID) async { + hasError = false; + Map body = Map(); + body['PresOrderID'] = presOrderID; + body['isDentalAllowedBackend'] = false; + await baseAppClient.post(GET_ORDER_DETAIL_BY_ID, + onSuccess: (dynamic response, int statusCode) { + hhcAllOrderDetail.clear(); + response['PatientER_HHC_GetTransactionsForOrderList'].forEach((data) { + hhcAllOrderDetail + .add(GetOrderDetailByOrderIDResponseModel.fromJson(data)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + Future updateHHCPresOrder(UpdatePresOrderRequestModel updatePresOrderRequestModel) async { + hasError = false; + await baseAppClient.post(PATIENT_ER_UPDATE_PRES_ORDER, + onSuccess: (dynamic response, int statusCode) { + isOrderUpdated = true; + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: updatePresOrderRequestModel.toJson()); + } + + Future insertPresPresOrder({PatientERInsertPresOrderRequestModel order}) async { + hasError = false; + await baseAppClient.post(INSERT_ER_INERT_PRES_ORDER, + onSuccess: (dynamic response, int statusCode) { + + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: order.toJson()); + } +} diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index f5725e5c..696489c6 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -77,12 +77,13 @@ class BaseAppClient { body['PatientID'] = body['PatientID'] != null ? body['PatientID'] : user['PatientID']; body['PatientOutSA'] = user['OutSA']; - body['SessionID'] = SESSION_ID;//getSessionId(token); + body['SessionID'] = SESSION_ID; //getSessionId(token); } } print("URL : $url"); print("Body : ${json.encode(body)}"); + var ss = json.encode(body); if (await Utils.checkConnection()) { final response = await http.post(url.trim(), @@ -138,33 +139,34 @@ class BaseAppClient { } } + get(String endPoint, + {Function(dynamic response, int statusCode) onSuccess, + Function(String error, int statusCode) onFailure, + Map queryParams}) async { + String url = BASE_URL + endPoint; + if (queryParams != null) { + String queryString = Uri(queryParameters: queryParams).query; + url += '?' + queryString; + } - get( - String endPoint, { - Function(dynamic response, int statusCode) onSuccess, - Function(String error, int statusCode) onFailure, - }) async { - try { - print("URL : $endPoint"); + print("URL : $url"); - if (await Utils.checkConnection()) { - onFailure('Please Check The Internet Connection', -1); + 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 { - final response = await http.get(endPoint, headers: { - 'Content-Type': 'application/json', - 'Accept': 'application/json' - }); - final int statusCode = response.statusCode; - if (statusCode < 200 || statusCode >= 400 || json == null) { - onFailure('Error While Fetching data', statusCode); - } else { - var parsed = json.decode(response.body.toString()); - onSuccess(parsed, statusCode); - } + var parsed = json.decode(response.body.toString()); + onSuccess(parsed, statusCode); } - } catch (e) { - print(e); - onFailure(e.toString(), -1); + } else { + onFailure('Please Check The Internet Connection', -1); } } diff --git a/lib/core/service/er/am_service.dart b/lib/core/service/er/am_service.dart index b654e0eb..2e9460b8 100644 --- a/lib/core/service/er/am_service.dart +++ b/lib/core/service/er/am_service.dart @@ -2,8 +2,10 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/enum/OrderService.dart'; import 'package:diplomaticquarterapp/core/model/er/PatientAllPresOrders.dart'; +import 'package:diplomaticquarterapp/core/model/er/PatientER.dart'; import 'package:diplomaticquarterapp/core/model/er/PickUpRequestPresOrder.dart'; import 'package:diplomaticquarterapp/core/model/er/get_all_transportation_method_list_model.dart'; +import 'package:flutter/cupertino.dart'; import '../base_service.dart'; class AmService extends BaseService { @@ -35,6 +37,7 @@ class AmService extends BaseService { Future getPatientAllPresOrdersList() async { hasError = false; hasPendingOrder = false; + pickUpRequestPresOrder = null; await baseAppClient.post(GET_PATIENT_ALL_PRES_ORDERS, onSuccess: (dynamic response, int statusCode) { patientAllPresOrdersList.clear(); @@ -58,12 +61,11 @@ class AmService extends BaseService { Future getOrderDetails() async { hasError = false; - hasPendingOrder = false; Map body = Map(); body['PresOrderID'] = pendingOrderID; + body['isDentalAllowedBackend'] = false; await baseAppClient.post(GET_PICK_UP_REQUEST_BY_PRES_ORDER_ID, onSuccess: (dynamic response, int statusCode) { - patientAllPresOrdersList.clear(); response['PatientER_RRT_GetPickUpRequestByPresOrderIDList'] .forEach((item) { pickUpRequestPresOrder = PickUpRequestPresOrder.fromJson(item); @@ -71,6 +73,35 @@ class AmService extends BaseService { }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, body: Map()); + }, body: body); + } + + Future updatePressOrder({@required int presOrderID}) async { + hasError = false; + Map body = Map(); + body['PresOrderID'] = presOrderID; + body['EditedBy'] = 3; + body['RejectionReason'] = ''; + body['PresOrderStatus'] = OrderService.AMBULANCE.getIdOrderService(); + body['isDentalAllowedBackend'] = false; + await baseAppClient.post(UPDATE_PRESS_ORDER, + onSuccess: (dynamic response, int statusCode) { + + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + Future insertERPressOrder({@required PatientER patientER}) async { + hasError = false; + + await baseAppClient.post(INSERT_ER_INERT_PRES_ORDER, + onSuccess: (dynamic response, int statusCode) { + + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: patientER.toJson()); } } diff --git a/lib/core/service/parmacyModule/order-preview-service.dart b/lib/core/service/parmacyModule/order-preview-service.dart new file mode 100644 index 00000000..1f3f9ddd --- /dev/null +++ b/lib/core/service/parmacyModule/order-preview-service.dart @@ -0,0 +1,29 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/pharmacies/Addresses.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; + +class OrderPreviewService extends BaseService{ + bool isFinished = true; + bool hasError = false; + String errorMsg = ''; + + List addresses = List(); + + Future getBannerListList() async { + hasError = false; + try { + await baseAppClient.get(GET_CUSTOMERS_ADDRESSES, + onSuccess: (dynamic response, int statusCode) { + addresses.clear(); + response['customers'][0]['addresses'].forEach((item) { + addresses.add(Addresses.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }); + } catch (error) { + throw error; + } + } +} \ 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 new file mode 100644 index 00000000..8584e140 --- /dev/null +++ b/lib/core/service/parmacyModule/parmacy_module_service.dart @@ -0,0 +1,97 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +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'; + +class PharmacyModuleService extends BaseService { + bool isFinished = true; + bool hasError = false; + String errorMsg = ''; + + List bannerItems = List(); + List manufacturerList = List(); + List bestSellerProducts = List(); + List lastVisitedProducts = List(); + + Future getBannerListList() async { + hasError = false; + try { + await baseAppClient.get(GET_PHARMACY_BANNER, + onSuccess: (dynamic response, int statusCode) { + bannerItems.clear(); + response['images'].forEach((item) { + bannerItems.add(PharmacyImageObject.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }); + } catch (error) { + throw error; + } + } + + Future getTopManufacturerList() async { + Map queryParams = {'page': '1', 'limit': '8'}; + try { + await baseAppClient.get(GET_PHARMACY_TOP_MANUFACTURER, + onSuccess: (dynamic response, int statusCode) { + manufacturerList.clear(); + response['manufacturer'].forEach((item) { + manufacturerList.add(Manufacturer.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, queryParams: queryParams); + } catch (error) { + throw error; + } + } + + Future getBestSellerProducts() async { + Map queryParams = { + 'fields': + 'id,discount_ids,name,namen,localized_names,display_order,short_description,full_description,full_descriptionn,sku,order_minimum_quantity,order_maximum_quantity,price,old_price,images,is_rx,rx_message,rx_messagen,discount_name,discount_namen,approved_rating_sum,approved_total_reviews,allow_back_in_stock_subscriptions,stock_quantity,stock_availability,stock_availabilityn,discount_percentage,reviews', + }; + try { + await baseAppClient.get(GET_PHARMACY_BEST_SELLER_PRODUCT, + onSuccess: (dynamic response, int statusCode) { + bestSellerProducts.clear(); + response['products'].forEach((item) { + bestSellerProducts.add(PharmacyProduct.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, queryParams: queryParams); + } catch (error) { + throw error; + } + } + + Future getLastVisitedProducts() async { + String lastVisited = ""; + if (await this.sharedPref.getString(PHARMACY_LAST_VISITED_PRODUCTS) != + null) { + lastVisited = + await this.sharedPref.getString(PHARMACY_LAST_VISITED_PRODUCTS); + try { + await baseAppClient.get("$GET_PHARMACY_PRODUCTs_BY_IDS$lastVisited", + onSuccess: (dynamic response, int statusCode) { + 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/viewModels/AlHabibMedicalService/H2O_view_model.dart b/lib/core/viewModels/AlHabibMedicalService/H2O_view_model.dart index 73a56d9b..15b00e37 100644 --- a/lib/core/viewModels/AlHabibMedicalService/H2O_view_model.dart +++ b/lib/core/viewModels/AlHabibMedicalService/H2O_view_model.dart @@ -1,8 +1,8 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; -import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/insert_user_activity_request_model.dart'; -import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/user_progress_for_month_data_model.dart'; -import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/user_progress_for_today_data_model.dart'; -import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/user_progress_for_week_data_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/insert_user_activity_request_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/user_progress_for_month_data_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/user_progress_for_today_data_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/user_progress_for_week_data_model.dart'; import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/H2O_service.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; import 'package:charts_flutter/flutter.dart' as charts; diff --git a/lib/core/viewModels/AlHabibMedicalService/cmc_view_model.dart b/lib/core/viewModels/AlHabibMedicalService/cmc_view_model.dart new file mode 100644 index 00000000..bf3404a9 --- /dev/null +++ b/lib/core/viewModels/AlHabibMedicalService/cmc_view_model.dart @@ -0,0 +1,110 @@ +import 'package:diplomaticquarterapp/core/enum/OrderService.dart'; +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_get_items_request_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_get_items_response_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/get_cmc_service_response_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_hhc_all_pres_orders_response_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_order_detail_by_order_iD_request_model.dart'; +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/viewModels/base_view_model.dart'; + +import '../../../locator.dart'; + +class CMCViewModel extends BaseViewModel { + CMCService _cMCService = + locator(); + + List get cmcAllServicesList => + + _cMCService.cmcAllServicesList; + + List get cmcAllPresOrders => + _cMCService.cmcAllPresOrdersList; + + List get cmcAllOrderDetail => + _cMCService.cmcAllOrderDetail; + List get checkupItems => + _cMCService.checkupItemsList; + + bool get isOrderUpdated => _cMCService.isOrderUpdated; + + Future getCMCAllServices() async { + await _cMCService + .getCMCAllServices(); + CMCGetItemsRequestModel cMCGetItemsRequestModel = new CMCGetItemsRequestModel(checkupType: cmcAllServicesList[0].iD); + + await getCheckupItems(cMCGetItemsRequestModel: cMCGetItemsRequestModel,isFirst: true); + if (_cMCService.hasError) { + error = _cMCService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + Future getCheckupItems({CMCGetItemsRequestModel cMCGetItemsRequestModel, bool isFirst = false}) async { + if(!isFirst) + setState(ViewState.Busy); + await _cMCService.getCheckupItems(cMCGetItemsRequestModel); + if (_cMCService.hasError) { + error = _cMCService.error; + setState(ViewState.Error); + } + if(!isFirst) + setState(ViewState.Idle); + } + + Future getCmcAllPresOrders() async { + setState(ViewState.Busy); + await _cMCService.getCmcAllPresOrders(); + if (_cMCService.hasError) { + error = _cMCService.error; + setState(ViewState.Error); + } else { + var pendingOrder = _cMCService.cmcAllPresOrdersList.firstWhere( + (element) => element.status == 1 || element.status == 2, + orElse: () => null); + if (pendingOrder != null) { + await getOrderDetailByOrderID(pendingOrder); + setState(ViewState.Idle); + } else { + getCMCAllServices(); + } + } + } + + Future updateCmcPresOrder( + UpdatePresOrderRequestModel updatePresOrderRequestModel) async { + setState(ViewState.BusyLocal); + await _cMCService.updateCmcPresOrder( + updatePresOrderRequestModel); + if (_cMCService.hasError) { + error = _cMCService.error; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } + + Future getOrderDetailByOrderID(GetHHCAllPresOrdersResponseModel order) async { + GetOrderDetailByOrderIDRequestModel getOrderDetailByOrderIDRequestModel = + GetOrderDetailByOrderIDRequestModel(presOrderID: order.iD); + await _cMCService + .getOrderDetailByOrderID(getOrderDetailByOrderIDRequestModel); + } + //TODO check it in uat + Future insertPresPresOrder({CMCInsertPresOrderRequestModel order}) async { + setState(ViewState.Busy); + order.createdBy = user.patientID; + order.orderServiceID = OrderService.Comprehensive_Medical_Checkup.getIdOrderService(); + await _cMCService.insertPresPresOrder(order: order); + if (_cMCService.hasError) { + error = _cMCService.error; + setState(ViewState.ErrorLocal); + } else { + getCmcAllPresOrders(); + } + } +} \ 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 new file mode 100644 index 00000000..031d0a0c --- /dev/null +++ b/lib/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart @@ -0,0 +1,97 @@ +import 'package:diplomaticquarterapp/core/enum/OrderService.dart'; +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/HHC_get_all_services_request_modle.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/HHC_get_all_services_response_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/PatientERHHCInsertServicesList.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_hhc_all_pres_orders_response_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_order_detail_by_order_iD_request_model.dart'; +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/home_health_care_service.dart'; +import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; + +import '../../../locator.dart'; + +class HomeHealthCareViewModel extends BaseViewModel { + HomeHealthCareService _homeHealthCareService = + locator(); + + List get hhcAllServicesList => + _homeHealthCareService.hhcAllServicesList; + + List get hhcAllPresOrders => + _homeHealthCareService.hhcAllPresOrdersList; + + List get hhcAllOrderDetail => + _homeHealthCareService.hhcAllOrderDetail; + + bool get isOrderUpdated => _homeHealthCareService.isOrderUpdated; + + GetHHCAllPresOrdersResponseModel pendingOrder; + + List patientERHHCInsertServicesList = List(); + + Future getHHCAllServices() async { + HHCGetAllServicesRequestModel hHCGetAllServicesRequestModel = + new HHCGetAllServicesRequestModel(); + //setState(ViewState.Busy); + await _homeHealthCareService + .getHHCAllServices(hHCGetAllServicesRequestModel); + if (_homeHealthCareService.hasError) { + error = _homeHealthCareService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + + Future getHHCAllPresOrders() async { + pendingOrder = null; + setState(ViewState.Busy); + await _homeHealthCareService.getHHCAllPresOrders(); + if (_homeHealthCareService.hasError) { + error = _homeHealthCareService.error; + setState(ViewState.Error); + } else { + pendingOrder = _homeHealthCareService.hhcAllPresOrdersList + .firstWhere((element) => element.status == 1 || element.status == 2, + orElse: () => null); + if (pendingOrder != null) { + await _homeHealthCareService.getOrderDetailByOrderID(pendingOrder.iD); + setState(ViewState.Idle); + } else { + getHHCAllServices(); + } + + } + } + + Future updateHHCPresOrder(UpdatePresOrderRequestModel updatePresOrderRequestModel) async { + setState(ViewState.Busy); + await _homeHealthCareService.updateHHCPresOrder( + updatePresOrderRequestModel); + if (_homeHealthCareService.hasError) { + error = _homeHealthCareService.error; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } + + Future insertPresPresOrder({PatientERInsertPresOrderRequestModel order}) async { + setState(ViewState.Busy); + order.createdBy = user.patientID; + order.orderServiceID = OrderService.HOME_HEALTH_CARE.getIdOrderService(); + await _homeHealthCareService.insertPresPresOrder(order: order); + if (_homeHealthCareService.hasError) { + error = _homeHealthCareService.error; + setState(ViewState.ErrorLocal); + } else { + getHHCAllPresOrders(); + } + } + + + +} \ No newline at end of file diff --git a/lib/core/viewModels/er/am_request_view_model.dart b/lib/core/viewModels/er/am_request_view_model.dart index fbd3d95d..2cf8e877 100644 --- a/lib/core/viewModels/er/am_request_view_model.dart +++ b/lib/core/viewModels/er/am_request_view_model.dart @@ -1,5 +1,7 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/er/PatientAllPresOrders.dart'; +import 'package:diplomaticquarterapp/core/model/er/PatientER.dart'; +import 'package:diplomaticquarterapp/core/model/er/PickUpRequestPresOrder.dart'; import 'package:diplomaticquarterapp/core/model/er/get_all_transportation_method_list_model.dart'; import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; import 'package:diplomaticquarterapp/core/service/er/am_service.dart'; @@ -7,6 +9,7 @@ import 'package:diplomaticquarterapp/core/service/hospital_service.dart'; import 'package:diplomaticquarterapp/core/service/medical/medical_service.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; +import 'package:flutter/cupertino.dart'; import '../base_view_model.dart'; import '../../../locator.dart'; @@ -28,6 +31,8 @@ class AmRequestViewModel extends BaseViewModel { bool get hasPendingOrder =>_amService.hasPendingOrder; + PickUpRequestPresOrder get pickUpRequestPresOrder =>_amService.pickUpRequestPresOrder; + Future getAppointmentHistory() async { setState(ViewState.BusyLocal); await _medicalService.getAppointmentHistory(isActiveAppointment: true); @@ -73,10 +78,31 @@ class AmRequestViewModel extends BaseViewModel { Future getOrderDetails() async { setState(ViewState.Busy); await _amService.getOrderDetails(); - if (_hospitalService.hasError) { - error = _hospitalService.error; + if (_amService.hasError) { + error = _amService.error; setState(ViewState.Error); } else setState(ViewState.Idle); } + + Future updatePressOrder({@required int presOrderID}) async { + setState(ViewState.Busy); + await _amService.updatePressOrder(presOrderID: presOrderID); + if (_amService.hasError) { + error = _amService.error; + setState(ViewState.Error); + } else + getPatientAllPresOrdersList(); + } + + Future insertERPressOrder({@required PatientER patientER}) async { + setState(ViewState.Busy); + await _amService.insertERPressOrder(patientER: patientER); + if (_amService.hasError) { + error = _amService.error; + setState(ViewState.ErrorLocal); + } else + getAmRequestOrders(); + + } } diff --git a/lib/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart b/lib/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart new file mode 100644 index 00000000..00f4819b --- /dev/null +++ b/lib/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart @@ -0,0 +1,8 @@ +import 'package:diplomaticquarterapp/core/service/parmacyModule/order-preview-service.dart'; + +import '../../../locator.dart'; +import '../base_view_model.dart'; + +class OrderPreviewViewModel extends BaseViewModel { + OrderPreviewService _orderService = locator(); +} diff --git a/lib/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart b/lib/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart new file mode 100644 index 00000000..f8c574f7 --- /dev/null +++ b/lib/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart @@ -0,0 +1,73 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +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/parmacyModule/parmacy_module_service.dart'; +import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; + +import '../../../locator.dart'; + +class PharmacyModuleViewModel extends BaseViewModel { + PharmacyModuleService _pharmacyService = locator(); + + List get bannerList => _pharmacyService.bannerItems; + + List get manufacturerList => _pharmacyService.manufacturerList; + + List get bestSellerProduct => + _pharmacyService.bestSellerProducts; + + List get lastVisitedProducts => + _pharmacyService.lastVisitedProducts; + + Future getPharmacyHomeData() async { + setState(ViewState.Busy); + await _pharmacyService.getBannerListList(); + if (_pharmacyService.hasError) { + error = _pharmacyService.error; + setState(ViewState.Error); + } else { + _getTopManufacturerList(); + } + } + + List getBannerImagesUrl() { + List images = List(); + images.add('assets/images/pharmacy_module/pharmacy_logo_green.png'); + _pharmacyService.bannerItems.forEach((element) { + images.add(element.src); + }); + + return images; + } + + _getTopManufacturerList() async { + await _pharmacyService.getTopManufacturerList(); + if (_pharmacyService.hasError) { + error = _pharmacyService.error; + setState(ViewState.Error); + } else { + _getBestSellerProducts(); + } + } + + _getBestSellerProducts() async { + await _pharmacyService.getBestSellerProducts(); + if (_pharmacyService.hasError) { + error = _pharmacyService.error; + setState(ViewState.Error); + } else { + _getLastVisitedProducts(); + } + } + + _getLastVisitedProducts() async { + await _pharmacyService.getLastVisitedProducts(); + if (_pharmacyService.hasError) { + error = _pharmacyService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } +} diff --git a/lib/core/viewModels/qr_view_model.dart b/lib/core/viewModels/qr_view_model.dart index cc03d9ab..03c88462 100644 --- a/lib/core/viewModels/qr_view_model.dart +++ b/lib/core/viewModels/qr_view_model.dart @@ -1,6 +1,6 @@ import 'dart:convert'; -import 'package:barcode_scan/platform_wrapper.dart'; +// import 'package:barcode_scan/platform_wrapper.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/qr/qr_parking_model.dart'; @@ -14,25 +14,26 @@ class QrViewModel extends BaseViewModel { QRParkingModel qrParkingModel; readQr() async { - var result = await BarcodeScanner.scan(); - var data = json.decode(result.rawContent); - var qRParkingID = data['QRParkingID']; - setState(ViewState.BusyLocal); - await _qrService.getQRParkingByID(qRParkingID); - if (_qrService.hasError) { - error = _qrService.error; - setState(ViewState.ErrorLocal); - } else { - if (_qrService.qRParkingList.length > 0) { - qrParkingModel = _qrService.qRParkingList[0]; - await sharedPref.setObject(IS_GO_TO_PARKING, qrParkingModel); - isSavePark = true; - setState(ViewState.Idle); - } else { - error = "Invalid Qr Code"; - setState(ViewState.ErrorLocal); - } - } + //TODO fix the barcode scan + // var result = await BarcodeScanner.scan(); + // var data = json.decode(result.rawContent); + // var qRParkingID = data['QRParkingID']; + // setState(ViewState.BusyLocal); + // await _qrService.getQRParkingByID(qRParkingID); + // if (_qrService.hasError) { + // error = _qrService.error; + // setState(ViewState.ErrorLocal); + // } else { + // if (_qrService.qRParkingList.length > 0) { + // qrParkingModel = _qrService.qRParkingList[0]; + // await sharedPref.setObject(IS_GO_TO_PARKING, qrParkingModel); + // isSavePark = true; + // setState(ViewState.Idle); + // } else { + // error = "Invalid Qr Code"; + // setState(ViewState.ErrorLocal); + // } + // } } getIsSaveParking() async { diff --git a/lib/d_q_icons_icons.dart b/lib/d_q_icons_icons.dart index fc9679ca..040e6e08 100644 --- a/lib/d_q_icons_icons.dart +++ b/lib/d_q_icons_icons.dart @@ -30,4 +30,16 @@ class DQIcons { static const IconData thermometer = IconData(0xe806, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData weight_scale = IconData(0xe807, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData parking_icon = IconData(0xe808, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData more_menu_icon = IconData(0xe809, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData offer_icon = IconData(0xe80a, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData prescription_icon = IconData(0xe80b, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData search_scan_icon = IconData(0xe80c, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData share_icon = IconData(0xe80d, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData wishlist_add_icon = IconData(0xe80e, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData wishlist_icon = IconData(0xe80f, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData bg_1 = IconData(0xe810, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData bg_2 = IconData(0xe811, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData bg_3 = IconData(0xe812, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData bg_4 = IconData(0xe813, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData medication_icon = IconData(0xe814, fontFamily: _kFontFam, fontPackage: _kFontPkg); } diff --git a/lib/locator.dart b/lib/locator.dart index e6140ce1..a7352b47 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -2,11 +2,14 @@ import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/H2O_serv import 'package:diplomaticquarterapp/core/service/qr_service.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/user_information_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart'; import 'package:diplomaticquarterapp/uitl/navigation_service.dart'; import 'package:get_it/get_it.dart'; +import 'core/service/AlHabibMedicalService/cmc_service.dart'; import 'core/service/AlHabibMedicalService/e_referral_service.dart'; +import 'core/service/AlHabibMedicalService/home_health_care_service.dart'; import 'core/service/AuthenticatedUserObject.dart'; import 'core/service/appointment_rate_service.dart'; import 'core/service/blood/blood_details_servies.dart'; @@ -39,6 +42,10 @@ import 'core/service/medical/prescriptions_service.dart'; import 'core/service/medical/radiology_service.dart'; import 'core/service/medical/reports_monthly_service.dart'; import 'core/service/medical/vital_sign_service.dart'; +import 'core/service/parmacyModule/order-preview-service.dart'; +import 'core/viewModels/AlHabibMedicalService/cmc_view_model.dart'; +import 'core/service/parmacyModule/parmacy_module_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'; @@ -74,6 +81,8 @@ import 'core/viewModels/pharmacies_view_model.dart'; import 'core/service/pharmacies_service.dart'; import 'core/service/insurance_service.dart'; import 'core/viewModels/insurance_card_View_model.dart'; +import 'core/viewModels/pharmacyModule/OrderPreviewViewModel.dart'; +import 'core/viewModels/pharmacyModule/pharmacy_module_view_model.dart'; import 'core/viewModels/qr_view_model.dart'; import 'core/viewModels/vaccine_view_model.dart'; import 'core/service/vaccine_service.dart'; @@ -104,6 +113,8 @@ void setupLocator() { locator.registerLazySingleton(() => ErService()); locator.registerLazySingleton(() => AmService()); locator.registerLazySingleton(() => EReferralService()); + locator.registerLazySingleton(() => HomeHealthCareService()); + locator.registerLazySingleton(() => CMCService()); locator.registerLazySingleton(() => PatientSickLeaveService()); @@ -126,9 +137,11 @@ void setupLocator() { locator.registerLazySingleton(() => CreteNewBabyService()); locator.registerLazySingleton(() => DeleteBabyService()); + locator.registerLazySingleton(() => VaccinationTableService()); - locator.registerLazySingleton(() => VaccinationTableService()); + locator.registerLazySingleton(() => PharmacyModuleService()); + locator.registerLazySingleton(() => OrderPreviewService()); /// View Model @@ -165,12 +178,20 @@ void setupLocator() { locator.registerFactory(() => AddNewChildViewModel()); locator.registerFactory(() => H2OViewModel()); - locator.registerFactory(() => BloodSugarViewMode()); locator.registerFactory(() => BloodPressureViewMode()); locator.registerFactory(() => WeightPressureViewMode()); locator.registerFactory(() => EyeViewModel()); locator.registerFactory(() => ActiveMedicationsViewModel()); locator.registerFactory(() => AskDoctorViewModel()); + locator.registerFactory(() => AllergiesViewModel()); + locator.registerFactory(() => HomeHealthCareViewModel()); + locator.registerFactory(() => CMCViewModel()); + + + + locator.registerFactory(() => PharmacyModuleViewModel()); + locator.registerFactory(() => OrderPreviewViewModel()); + } diff --git a/lib/main.dart b/lib/main.dart index d8e3307d..9cb5cb78 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -54,6 +54,7 @@ class MyApp extends StatelessWidget { const Locale('en', ''), // English ], theme: ThemeData( + fontFamily: projectProvider.isArabic ? 'Cairo' : 'WorkSans', primarySwatch: Colors.blue, visualDensity: VisualDensity.adaptivePlatformDensity, brightness: Brightness.light, @@ -66,8 +67,7 @@ class MyApp extends StatelessWidget { hintColor: Colors.grey[400], disabledColor: Colors.grey[300], errorColor: Color.fromRGBO(235, 80, 60, 1.0), - scaffoldBackgroundColor: - HexColor('#E9E9E9'), // Colors.grey[100], + scaffoldBackgroundColor: HexColor('#E9E9E9'), // Colors.grey[100], textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5), textSelectionHandleColor: Colors.grey, canvasColor: Colors.white, diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/Dialog/confirm_cancel_order_dialog.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/Dialog/confirm_cancel_order_dialog.dart new file mode 100644 index 00000000..45bf01b7 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/Dialog/confirm_cancel_order_dialog.dart @@ -0,0 +1,104 @@ +import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_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'; + +// ignore: must_be_immutable +class ConfirmCancelOrderDialog extends StatefulWidget { + final CMCViewModel model; + final Function onTap; + + + ConfirmCancelOrderDialog( + {Key key, this.model, this.onTap}); + + @override + _ConfirmCancelOrderDialogState createState() => _ConfirmCancelOrderDialogState(); +} + +class _ConfirmCancelOrderDialogState extends State { + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { + return SimpleDialog( + contentPadding: EdgeInsets.fromLTRB(28.0, 24.0, 28.0, 0.0), + title: Center( + child: Texts( + "Confirm", + color: Colors.black, + ), + ), + children: [ + Column( + children: [ + Divider(), + Center( + child: Texts( + "Are you sure!! want to cancel this order", + color: Colors.grey, + ), + ), + SizedBox( + height: 5.0, + ), + Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + 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: () async{ + widget.onTap(); + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Texts( + TranslationBase.of(context).ok, + fontWeight: FontWeight.w400, + )), + ), + ), + ), + ], + ) + ], + ) + ], + ); + } +} + + + diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_page.dart new file mode 100644 index 00000000..532396cc --- /dev/null +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_page.dart @@ -0,0 +1,346 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart'; +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/viewModels/AlHabibMedicalService/cmc_view_model.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/Dialog/confirm_cancel_order_dialog.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/StepsWidget.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/material.dart'; +import 'package:geolocator/geolocator.dart'; + +import 'new_cmc_step_one_page.dart'; +import 'new_cmc_step_three_page.dart'; +import 'new_cmc_step_tow_page.dart'; + +class NewCMCPage extends StatefulWidget { + NewCMCPage({this.model}); + + final CMCViewModel model; + + @override + _NewCMCPageState createState() => + _NewCMCPageState(); +} + +class _NewCMCPageState extends State + with TickerProviderStateMixin { + PageController _controller; + int _currentIndex = 1; + + double _latitude; + double _longitude; + + CMCInsertPresOrderRequestModel cMCInsertPresOrderRequestModel; + + @override + void initState() { + super.initState(); + PatientERCMCInsertServicesList patientERCMCInsertServicesList; + if (widget.model.cmcAllServicesList.length > 0) { + patientERCMCInsertServicesList = new PatientERCMCInsertServicesList( + price: widget.model.cmcAllServicesList[0].price, + serviceID: widget.model.cmcAllServicesList[0].serviceID.toString(), + selectedServiceName: widget.model.cmcAllServicesList[0].description, + selectedServiceNameAR: widget.model.cmcAllServicesList[0].description, + recordID: 1, + totalPrice: widget.model.cmcAllServicesList[0].totalPrice, + vAT: widget.model.cmcAllServicesList[0].vAT); + cMCInsertPresOrderRequestModel = new CMCInsertPresOrderRequestModel( + patientERCMCInsertServicesList: [patientERCMCInsertServicesList]); + } + + cMCInsertPresOrderRequestModel = new CMCInsertPresOrderRequestModel( + patientERCMCInsertServicesList: patientERCMCInsertServicesList != null + ? [patientERCMCInsertServicesList] + : []); + + _controller = new PageController(); + + _getCurrentLocation(); + } + + _getCurrentLocation() async { + await getLastKnownPosition().then((value) { + _latitude = value.latitude; + _longitude = value.longitude; + }).catchError((e) { + _longitude = 0; + _latitude = 0; + }); + } + + @override + void dispose() { + super.dispose(); + } + + changePageViewIndex(pageIndex) { + _controller.jumpToPage(pageIndex); + } + + @override + Widget build(BuildContext context) { + void showConfirmMessage( + CMCViewModel model, GetOrderDetailByOrderIDResponseModel order) { + showDialog( + context: context, + child: ConfirmCancelOrderDialog( + model: model, + onTap: () async { + UpdatePresOrderRequestModel updatePresOrderRequestModel = + UpdatePresOrderRequestModel( + presOrderID: order.presOrderID, + rejectionReason: "", + presOrderStatus: 4, editedBy: 3); + await model.updateCmcPresOrder(updatePresOrderRequestModel); + if (model.state == ViewState.ErrorLocal) { + Utils.showErrorToast(model.error); + } else { + AppToast.showSuccessToast(message: "Done Successfully"); + await model.getCmcAllPresOrders(); + } + }, + )); + } + return Scaffold( + body: SafeArea( + child: SingleChildScrollView( + child: Container( + height: MediaQuery.of(context).size.height * 0.8, + child: Column( + children: [ + Container( + margin: EdgeInsets.only(left: MediaQuery.of(context).size.width*0.05, right: MediaQuery.of(context).size.width*0.05), + child: StepsWidget( + index: _currentIndex, + changeCurrentTab: changePageViewIndex, + ), + ), + Expanded( + child: PageView( + physics: NeverScrollableScrollPhysics(), + controller: _controller, + onPageChanged: (index) { + setState(() { + _currentIndex = index; + }); + }, + scrollDirection: Axis.horizontal, + children: [ + widget.model.cmcAllOrderDetail.length != 0 + ? FractionallySizedBox( + heightFactor: 0.8, + widthFactor: 0.9, + child: Container( + width: double.infinity, + margin: EdgeInsets.only(top: 15), + decoration: BoxDecoration( + border: + Border.all(color: Colors.grey, width: 1), + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 12, + ), + Container( + width: double.infinity, + padding: EdgeInsets.only( + left: 15, bottom: 15, top: 15), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Colors.grey, + width: 1.0, + ), + ), + // borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + "Request ID", + bold: false, + fontSize: 13, + ), + SizedBox( + height: 4, + ), + Texts( + widget.model.cmcAllOrderDetail[0].iD.toString(), + fontSize: 22, + ), + ], + ), + ), + Container( + width: double.infinity, + padding: EdgeInsets.only( + left: 15, bottom: 15, top: 15), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Colors.grey, + width: 1.0, + ), + ), + // borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + "Status", + bold: false, + fontSize: 13, + ), + SizedBox( + height: 4, + ), + Texts( + "Pending", + fontSize: 22, + ), + ], + ), + ), + Container( + width: double.infinity, + padding: EdgeInsets.only( + left: 15, bottom: 15, top: 15), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Colors.grey, + width: 1.0, + ), + ), + // borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + "Pickup Date", + bold: false, + fontSize: 13, + ), + SizedBox( + height: 4, + ), + Texts( + DateUtil.getDayMonthYearDateFormatted( + DateUtil.convertStringToDate( + widget.model.cmcAllOrderDetail[0] + .createdOn)), + fontSize: 22, + ), + ], + ), + ), + Container( + width: double.infinity, + padding: EdgeInsets.only( + left: 15, bottom: 15, top: 15), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Colors.grey, + width: 1.0, + ), + ), + // borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + "Service Name", + bold: false, + fontSize: 13, + ), + SizedBox( + height: 4, + ), + Texts( + widget.model.cmcAllOrderDetail[0].description + .toString() ?? + widget.model.cmcAllOrderDetail[0] + .descriptionN + .toString(), + fontSize: 22, + ), + ], + ), + ), + SizedBox( + height: 12, + ), + Center( + child: Container( + width: MediaQuery + .of(context) + .size + .width * + 0.85, + child: SecondaryButton( + label: "Cancel".toUpperCase(), + onTap: () { + showConfirmMessage(widget.model, + widget.model.cmcAllOrderDetail[0]); + } + , + color: Colors.red[800], + disabled: false, + textColor: Theme + .of(context) + .backgroundColor), + ), + ), + SizedBox( + height: 12, + ), + ], + ), + ), + ) + : NewCMCStepOnePage( + changePageViewIndex: changePageViewIndex, + cMCInsertPresOrderRequestModel: + cMCInsertPresOrderRequestModel, + model: widget.model, + ), + NewCMCStepTowPage( + longitude: _longitude, + latitude: _latitude, + changePageViewIndex: changePageViewIndex, + cmcInsertPresOrderRequestModel: cMCInsertPresOrderRequestModel, + model: widget.model, + ), NewCMCStepThreePage( + changePageViewIndex: changePageViewIndex, + cmcInsertPresOrderRequestModel: cMCInsertPresOrderRequestModel, + model: widget.model, + ), + ], + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_one_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_one_page.dart new file mode 100644 index 00000000..02d099b4 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_one_page.dart @@ -0,0 +1,231 @@ +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_get_items_request_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.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'; + +class NewCMCStepOnePage extends StatefulWidget { + final CMCInsertPresOrderRequestModel cMCInsertPresOrderRequestModel; + final Function changePageViewIndex; + final CMCViewModel model; + + const NewCMCStepOnePage( + {Key key, + this.cMCInsertPresOrderRequestModel, + this.model, + this.changePageViewIndex}) + : super(key: key); + + @override + _NewCMCStepOnePageState createState() => _NewCMCStepOnePageState(); +} + +class _NewCMCStepOnePageState extends State { + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: false, + baseViewModel: widget.model, + body: SingleChildScrollView( + physics: ScrollPhysics(), + child: Container( + margin: EdgeInsets.all(12), + child: Center( + child: Column( + children: [ + FractionallySizedBox( + widthFactor: 0.94, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 20, + ), + Texts( + "Select Home Health Care Services", + textAlign: TextAlign.center, + ), + Column( + children: + widget.model.cmcAllServicesList.map((service) { + return Container( + margin: EdgeInsets.only(top: 15), + decoration: BoxDecoration( + border: + Border.all(color: Colors.grey, width: 1), + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + children: [ + Row( + children: [ + Radio( + value: service.serviceID, + activeColor: Colors.red[800], + onChanged: (newValue) async { + PatientERCMCInsertServicesList + patientERCMCInsertServicesList = + new PatientERCMCInsertServicesList( + price: service.price, + serviceID: service.serviceID + .toString(), + selectedServiceName: + service.description, + selectedServiceNameAR: + service.description, + recordID: 1, + totalPrice: + service.totalPrice, + vAT: service.vAT); + setState(() { + widget + .cMCInsertPresOrderRequestModel + .patientERCMCInsertServicesList = [ + patientERCMCInsertServicesList + ]; + }); + CMCGetItemsRequestModel + cMCGetItemsRequestModel = + new CMCGetItemsRequestModel( + checkupType: newValue); + await widget.model.getCheckupItems( + cMCGetItemsRequestModel: + cMCGetItemsRequestModel); + }, + groupValue: widget + .cMCInsertPresOrderRequestModel + .patientERCMCInsertServicesList + .length > + 0 + ? int.parse(widget + .cMCInsertPresOrderRequestModel + .patientERCMCInsertServicesList[ + 0] + .serviceID) + : 1), + Expanded( + child: Padding( + padding: const EdgeInsets.all(20.0), + child: Texts( + service.description, + fontSize: 15, + ), + ), + ), + ], + ), + ], + ), + ); + }).toList(), + ), + ], + ), + ), + SizedBox( + height: 30, + ), + Container( + color: Colors.white, + width: double.infinity, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: widget.model.checkupItems.map((item) { + return Center( + child: FractionallySizedBox( + widthFactor: 1, + child: Container( + margin: EdgeInsets.only(top: 15), + decoration: BoxDecoration(color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 12, + ), + Container( + width: double.infinity, + padding: EdgeInsets.only( + left: 15, bottom: 5, top: 5), + decoration: BoxDecoration( + border: BorderDirectional( + bottom: BorderSide( + style: BorderStyle.solid, + width: 0.5, + color: Colors.grey)), + //borderRadius: , + color: Colors.white), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + item.itemName, + fontSize: 15, + ), + ], + ), + ), + SizedBox( + height: 12, + ), + ], + ), + ), + ), + ); + }).toList()), + ) + ], + ), + ), + ), + ), + bottomSheet: Container( + height: MediaQuery.of(context).size.height * 0.10, + width: double.infinity, + child: Column( + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.9, + child: SecondaryButton( + label: "Next", + textColor: Theme.of(context).backgroundColor, + onTap: () { + if (widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList.length = null) { + int index = widget.model.cmcAllServicesList.length; + PatientERCMCInsertServicesList + patientERCMCInsertServicesList = + new PatientERCMCInsertServicesList( + price: widget.model.cmcAllServicesList[index-1].price, + serviceID: widget.model.cmcAllServicesList[index-1].serviceID.toString(), + selectedServiceName: widget.model.cmcAllServicesList[index-1].description, + selectedServiceNameAR: widget.model.cmcAllServicesList[index-1].description, + recordID: 1, + totalPrice: widget.model.cmcAllServicesList[index-1].totalPrice, + vAT: widget.model.cmcAllServicesList[index-1].vAT); + + widget.cMCInsertPresOrderRequestModel + .patientERCMCInsertServicesList = [ + patientERCMCInsertServicesList + ]; + + widget.changePageViewIndex(1); + } + }, + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_three_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_three_page.dart new file mode 100644 index 00000000..e48bb5d5 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_three_page.dart @@ -0,0 +1,165 @@ +import 'dart:async'; + +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.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:google_maps_flutter/google_maps_flutter.dart'; + +class NewCMCStepThreePage extends StatefulWidget { + final CMCInsertPresOrderRequestModel cmcInsertPresOrderRequestModel; + final Function changePageViewIndex; + final CMCViewModel model; + + NewCMCStepThreePage( + {Key key, + this.changePageViewIndex, + this.model, + this.cmcInsertPresOrderRequestModel}); + + @override + _NewCMCStepThreePageState createState() => + _NewCMCStepThreePageState(); +} + +class _NewCMCStepThreePageState + extends State { + Completer _controller = Completer(); + + static CameraPosition _kGooglePlex = CameraPosition( + target: LatLng(37.42796133580664, -122.085749655962), + zoom: 14.4746, + ); + final Set markers = new Set(); + + @override + void initState() { + if (widget.cmcInsertPresOrderRequestModel.latitude != null) { + markers.clear(); + markers.add( + Marker( + markerId: MarkerId( + widget.cmcInsertPresOrderRequestModel.latitude.hashCode + .toString(), + ), + position: LatLng( + widget.cmcInsertPresOrderRequestModel.latitude, + widget.cmcInsertPresOrderRequestModel.longitude)), + ); + _kGooglePlex = CameraPosition( + target: LatLng(widget.cmcInsertPresOrderRequestModel.latitude, + widget.cmcInsertPresOrderRequestModel.longitude), + zoom: 14.4746, + ); + } + super.initState(); + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowDecPage: false, + baseViewModel: widget.model, + body: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Container( + height: 400, + width: double.maxFinite, + margin: EdgeInsets.only(left: 12, right: 12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts('Order Details'), + SizedBox( + height: 12, + ), + Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12)), + padding: EdgeInsets.all(8), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts('Location :'), + SizedBox( + height: 12, + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + height: 200, + child: GoogleMap( + mapType: MapType.normal, + markers: markers, + initialCameraPosition: _kGooglePlex, + onMapCreated: (GoogleMapController controller) { + _controller.complete(controller); + }, + ), + ), + ), + SizedBox( + height: 12, + ), + Texts('Selected Service :'), + ...List.generate( + widget.cmcInsertPresOrderRequestModel.patientERCMCInsertServicesList.length, + (index) => Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + 'Service Name :', + fontSize: 12, + ), + SizedBox( + height: 5, + ), + Texts( + widget + .cmcInsertPresOrderRequestModel.patientERCMCInsertServicesList[index] + .selectedServiceName, + fontSize: 15, + bold: true, + ), + ], + ), + ), + ) + ], + ), + ) + ], + ), + ), + ), + bottomSheet: Container( + height: MediaQuery.of(context).size.height * 0.10, + width: double.infinity, + child: Column( + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.9, + child: SecondaryButton( + label: "Confirm", + onTap: () async { + await widget.model.insertPresPresOrder(order: widget.cmcInsertPresOrderRequestModel); + if (widget.model.state != ViewState.ErrorLocal) { + widget.changePageViewIndex(0); + } + }, + textColor: Theme.of(context).backgroundColor), + ), + ], + ), + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart new file mode 100644 index 00000000..27cddfe3 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart @@ -0,0 +1,113 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.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/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/others/close_back.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:google_maps_place_picker/google_maps_place_picker.dart'; +import 'package:google_maps_flutter/google_maps_flutter.dart'; +import 'package:provider/provider.dart'; + +class NewCMCStepTowPage extends StatefulWidget { + final Function(PickResult) onPick; + final double latitude; + final double longitude; + final CMCInsertPresOrderRequestModel cmcInsertPresOrderRequestModel; + final Function changePageViewIndex; + final CMCViewModel model; + + const NewCMCStepTowPage( + {Key key, + this.onPick, + this.latitude, + this.longitude, + this.cmcInsertPresOrderRequestModel, + this.changePageViewIndex, + this.model}) + : super(key: key); + + @override + _NewCMCStepTowPageState createState() => + _NewCMCStepTowPageState(); +} + +class _NewCMCStepTowPageState + extends State { + double latitude = 0; + double longitude = 0; + + @override + void initState() { + if (widget.cmcInsertPresOrderRequestModel.latitude == null) { + latitude = widget.latitude; + longitude = widget.longitude; + } else { + latitude = widget.cmcInsertPresOrderRequestModel.latitude; + longitude = widget.cmcInsertPresOrderRequestModel.longitude; + } + super.initState(); + } + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return AppScaffold( + isShowDecPage: false, + body: PlacePicker( + apiKey: GOOGLE_API_KEY, + enableMyLocationButton: true, + automaticallyImplyAppBarLeading: false, + autocompleteOnTrailingWhitespace: true, + selectInitialPosition: true, + autocompleteLanguage: projectViewModel.currentLanguage, + enableMapTypeButton: true, + onPlacePicked: (PickResult result) { + print(result.adrAddress); + widget.changePageViewIndex(3); + }, + selectedPlaceWidgetBuilder: + (_, selectedPlace, state, isSearchBarFocused) { + print("state: $state, isSearchBarFocused: $isSearchBarFocused"); + return isSearchBarFocused + ? Container() + : FloatingCard( + bottomPosition: 0.0, + leftPosition: 0.0, + rightPosition: 0.0, + width: 500, + borderRadius: BorderRadius.circular(12.0), + child: state == SearchingState.Searching + ? Center(child: CircularProgressIndicator()) + : Container( + margin: EdgeInsets.all(12), + child: SecondaryButton( + color: Colors.grey[800], + textColor: Colors.white, + onTap: () { + setState(() { + widget.cmcInsertPresOrderRequestModel + .latitude = + selectedPlace.geometry.location.lat; + widget.cmcInsertPresOrderRequestModel + .longitude = + selectedPlace.geometry.location.lng; + }); + widget.changePageViewIndex(3); + }, + label: TranslationBase.of(context).next, + ), + ), + ); + }, + initialPosition: LatLng(latitude, longitude), + useCurrentLocation: true, + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_index_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_index_page.dart new file mode 100644 index 00000000..e8e9eccc --- /dev/null +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_index_page.dart @@ -0,0 +1,68 @@ +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:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; +import 'cmc_page.dart'; + +class CMCIndexPage extends StatelessWidget { + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).serviceInformation, + body: SingleChildScrollView( + padding: EdgeInsets.all(12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + "CMC", + fontWeight: FontWeight.normal, + fontSize: 25, + color: Color(0xff60686b), + ), + SizedBox( + height: 12, + ), + Texts( + "This service is designed to help you to set drinking water goals and track the volume of water you are drinking on a daily basis. This service allows for schedule reminders and offers a basic statistical analysis of the amount of what you have consumed over the course of a day, week or month.", + fontWeight: FontWeight.normal, + fontSize: 17, + ), + SizedBox( + height: 22, + ), + Center( + child: Image.asset( + 'assets/images/AlHabibMedicalService/Wifi-AR.png')), + SizedBox( + height: 77, + ), + ], + )), + bottomSheet: Container( + height: MediaQuery.of(context).size.height * 0.10, + width: double.infinity, + child: Column( + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.9, + child: SecondaryButton( + onTap: () => Navigator.push( + context, + FadePage( + page: CMCPage(), + ), + ), + label: "CMC", + textColor: Theme.of(context).backgroundColor), + ), + ], + ), + )); + } +} diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart new file mode 100644 index 00000000..385d0da3 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart @@ -0,0 +1,130 @@ +import 'dart:ui'; + +import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'NewCMC/new_cmc_page.dart'; +import 'orders_log_details_page.dart'; + +class CMCPage extends StatefulWidget { + @override + _CMCPageState createState() => _CMCPageState(); +} + +class _CMCPageState extends State + with SingleTickerProviderStateMixin { + TabController _tabController; + + @override + void initState() { + super.initState(); + _tabController = TabController(length: 2, vsync: this); + } + + @override + void dispose() { + super.dispose(); + _tabController.dispose(); + } + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model){ + model.getCmcAllPresOrders(); + }, + builder: (_, model, widget) => AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).homeHealthCare, + 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.9, + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Theme.of(context).dividerColor, + width: 0.7), + ), + color: Colors.white), + child: Center( + child: TabBar( + 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], + tabs: [ + Container( + width: MediaQuery.of(context).size.width * 0.37, + child: Center( + child: Texts("CMC Service"), + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.37, + child: Center( + child: Texts(TranslationBase.of(context).orderLog), + ), + ), + ], + ), + ), + ), + ), + ], + ), + ), + body: Column( + children: [ + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + NewCMCPage( + model: model, + ), + OrdersLogDetailsPage( + model: model, + ) + ], + ), + ) + ], + ), + ), + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/orders_log_details_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/orders_log_details_page.dart new file mode 100644 index 00000000..6c915a4c --- /dev/null +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/orders_log_details_page.dart @@ -0,0 +1,250 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_hhc_all_pres_orders_response_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/utils.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/material.dart'; + +import 'Dialog/confirm_cancel_order_dialog.dart'; + +class OrdersLogDetailsPage extends StatelessWidget { + final CMCViewModel model; + + const OrdersLogDetailsPage({Key key, this.model}) : super(key: key); + + @override + Widget build(BuildContext context) { + void showConfirmMessage( + CMCViewModel model, GetHHCAllPresOrdersResponseModel order) { + showDialog( + context: context, + child: ConfirmCancelOrderDialog( + model: model, + onTap: () async { + UpdatePresOrderRequestModel updatePresOrderRequestModel = + UpdatePresOrderRequestModel( + presOrderID: order.iD, + rejectionReason: "", + presOrderStatus: 4, editedBy: 3); + await model.updateCmcPresOrder(updatePresOrderRequestModel); + if(model.state == ViewState.ErrorLocal) { + Utils.showErrorToast(model.error); + } else { + AppToast.showSuccessToast(message: "Done Successfully"); + await model.getCmcAllPresOrders(); + } + }, + )); + } + + return AppScaffold( + isShowAppBar: false, + baseViewModel: model, + body: SingleChildScrollView( + physics: ScrollPhysics(), + child: Container( + margin: EdgeInsets.all(12), + child: Center( + child: FractionallySizedBox( + widthFactor: 0.94, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 50, + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: model.cmcAllPresOrders.map((order) { + return Container( + width: double.infinity, + margin: EdgeInsets.only(top: 15), + decoration: BoxDecoration( + border: + Border.all(color: Colors.grey, width: 1), + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 12, + ), + Container( + width: double.infinity, + padding: EdgeInsets.only( + left: 15, bottom: 15, top: 15), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Colors.grey, + width: 1.0, + ), + ), + // borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + "Request ID", + bold: false, + fontSize: 13, + ), + SizedBox( + height: 4, + ), + Texts( + order.iD.toString(), + fontSize: 22, + ), + ], + ), + ), + Container( + width: double.infinity, + padding: EdgeInsets.only( + left: 15, bottom: 15, top: 15), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Colors.grey, + width: 1.0, + ), + ), + // borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + "Status", + bold: false, + fontSize: 13, + ), + SizedBox( + height: 4, + ), + Texts( + order.description, + fontSize: 22, + ), + ], + ), + ), + Container( + width: double.infinity, + padding: EdgeInsets.only( + left: 15, bottom: 15, top: 15), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Colors.grey, + width: 1.0, + ), + ), + // borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + "Pickup Date", + bold: false, + fontSize: 13, + ), + SizedBox( + height: 4, + ), + Texts( + DateUtil.getDayMonthYearDateFormatted( + DateUtil.convertStringToDate( + order.createdOn)), + fontSize: 22, + ), + ], + ), + ), + Container( + width: double.infinity, + padding: EdgeInsets.only( + left: 15, bottom: 15, top: 15), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Colors.grey, + width: 1.0, + ), + ), + // borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + "Location", + bold: false, + fontSize: 13, + ), + SizedBox( + height: 4, + ), + Texts( + order.nearestProjectDescription + .toString() ?? + order.nearestProjectDescriptionN + .toString(), + fontSize: 22, + ), + ], + ), + ), + SizedBox( + height: 12, + ), + if (order.status == 1 ||order.status == 2 ) + Center( + child: Container( + width: MediaQuery + .of(context) + .size + .width * + 0.85, + child: SecondaryButton( + label: "Cancel".toUpperCase(), + onTap: () { + showConfirmMessage(model, order); + } + , + color: Colors.red[800], + disabled: false, + textColor: Theme + .of(context) + .backgroundColor), + ), + ), + SizedBox( + height: 12, + ), + ], + ), + ); + }).toList()) + ], + ), + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_index_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_index_page.dart index 5787af66..fb2b94c6 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_index_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_index_page.dart @@ -1,5 +1,3 @@ - - import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/create_e_referral_request_model.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart'; import 'package:flutter/material.dart'; @@ -8,7 +6,6 @@ import 'new_e_referral_step_three_page.dart'; import 'new_e_referral_step_two_page.dart'; class StartIndexForNewEReferral extends StatefulWidget { - StartIndexForNewEReferral(); @override @@ -22,8 +19,8 @@ class _StartIndexForNewEReferralState extends State int _currentIndex = 1; int pageSelected = 2; - - CreateEReferralRequestModel createEReferralRequestModel = new CreateEReferralRequestModel(); + CreateEReferralRequestModel createEReferralRequestModel = + new CreateEReferralRequestModel(); @override void initState() { @@ -46,7 +43,7 @@ class _StartIndexForNewEReferralState extends State body: SafeArea( child: SingleChildScrollView( child: Container( - height: MediaQuery.of(context).size.height, + height: MediaQuery.of(context).size.height * 0.9, child: PageView( physics: NeverScrollableScrollPhysics(), controller: _controller, @@ -64,12 +61,10 @@ class _StartIndexForNewEReferralState extends State NewEReferralStepTowPage( changePageViewIndex: changePageViewIndex, createEReferralRequestModel: createEReferralRequestModel, - ), NewEReferralStepThreePage( changePageViewIndex: changePageViewIndex, createEReferralRequestModel: createEReferralRequestModel, - ), ], ), diff --git a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart index 6460de03..62799c6d 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart @@ -95,7 +95,7 @@ class _NewEReferralStepOnePageState extends State { margin: EdgeInsets.all(12), child: Center( child: FractionallySizedBox( - widthFactor: 0.94, + widthFactor: 0.9, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ diff --git a/lib/pages/AlHabibMedicalService/E-Referral/e_referral_index_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/e_referral_index_page.dart index ef0be383..c837bd2a 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/e_referral_index_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/e_referral_index_page.dart @@ -19,7 +19,7 @@ class EReferralIndexPage extends StatelessWidget { Widget build(BuildContext context) { return AppScaffold( isShowAppBar: true, - appBarTitle: "Service Information", + appBarTitle: TranslationBase.of(context).serviceInformation, body: SingleChildScrollView( padding: EdgeInsets.all(12), child: Column( diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/Dialog/confirm_cancel_order_dialog.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/Dialog/confirm_cancel_order_dialog.dart new file mode 100644 index 00000000..17be8edd --- /dev/null +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/Dialog/confirm_cancel_order_dialog.dart @@ -0,0 +1,103 @@ +import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_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'; + +// ignore: must_be_immutable +class ConfirmCancelOrderDialog extends StatefulWidget { + final HomeHealthCareViewModel model; + final Function onTap; + + + ConfirmCancelOrderDialog( + {Key key, this.model, this.onTap}); + + @override + _ConfirmCancelOrderDialogState createState() => _ConfirmCancelOrderDialogState(); +} + +class _ConfirmCancelOrderDialogState extends State { + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { + return SimpleDialog( + contentPadding: EdgeInsets.fromLTRB(28.0, 24.0, 28.0, 0.0), + title: Center( + child: Texts( + "Confirm", + color: Colors.black, + ), + ), + children: [ + Column( + children: [ + Divider(), + Center( + child: Texts( + "Are you sure!! want to cancel this order", + color: Colors.grey, + ), + ), + SizedBox( + height: 5.0, + ), + Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + 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: () async{ + widget.onTap(); + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Texts( + TranslationBase.of(context).ok, + fontWeight: FontWeight.w400, + )), + ), + ), + ), + ], + ) + ], + ) + ], + ); + } +} + + + diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart new file mode 100644 index 00000000..1dbee1b5 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart @@ -0,0 +1,177 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/PatientERHHCInsertServicesList.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.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:diplomaticquarterapp/widgets/pickupLocation/PickupLocationFromMap.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:geolocator/geolocator.dart'; +import 'package:google_maps_place_picker/google_maps_place_picker.dart'; + +class NewHomeHealthCareStepOnePage extends StatefulWidget { + final PatientERInsertPresOrderRequestModel + patientERInsertPresOrderRequestModel; + final Function changePageViewIndex; + final HomeHealthCareViewModel model; + + const NewHomeHealthCareStepOnePage( + {Key key, + this.patientERInsertPresOrderRequestModel, + this.model, + this.changePageViewIndex}) + : super(key: key); + + @override + _NewHomeHealthCareStepOnePageState createState() => + _NewHomeHealthCareStepOnePageState(); +} + +class _NewHomeHealthCareStepOnePageState extends State { + + PickResult _result; + + + @override + void initState() { + if (widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList == null) + widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList = []; + super.initState(); + } + + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: false, + baseViewModel: widget.model, + body: SingleChildScrollView( + physics: ScrollPhysics(), + child: Container( + margin: EdgeInsets.only( + left: MediaQuery.of(context).size.width * 0.05, + right: MediaQuery.of(context).size.width * 0.05), + child: Center( + child: FractionallySizedBox( + widthFactor: 1, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 12, + ), + Texts( + "Select Home Health Care Services", + textAlign: TextAlign.center, + ), + Column( + children: widget.model.hhcAllServicesList.map((service) { + return Container( + margin: EdgeInsets.only(top: 15), + decoration: BoxDecoration( + border: Border.all(color: Colors.grey, width: 1), + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + children: [ + Row( + children: [ + Checkbox( + value: isServiceSelected(service.serviceID), + activeColor: Colors.red[800], + onChanged: (bool newValue) { + setState(() { + if (!isServiceSelected( + service.serviceID)) + widget + .patientERInsertPresOrderRequestModel + .patientERHHCInsertServicesList + .add(PatientERHHCInsertServicesList( + recordID: widget + .patientERInsertPresOrderRequestModel + .patientERHHCInsertServicesList + .length, + serviceID: service.serviceID, + serviceName: + service.description)); + else + removeSelected(service.serviceID); + // widget.patientERInsertPresOrderRequestModel + // isPatientInsured = newValue; + }); + }), + Expanded( + child: Padding( + padding: const EdgeInsets.all(20.0), + child: Texts( + service.description, + fontSize: 15, + ), + ), + ), + ], + ), + ], + ), + ); + }).toList(), + ) + ], + ), + ), + ), + ), + ), + bottomSheet: Container( + height: MediaQuery.of(context).size.height * 0.10, + width: double.infinity, + child: Column( + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.9, + child: SecondaryButton( + label: "Next", + disabled: this + .widget + .patientERInsertPresOrderRequestModel + .patientERHHCInsertServicesList + .length == 0, + onTap: (){ + widget.changePageViewIndex(1); + }, + textColor: Theme.of(context).backgroundColor), + ), + ], + ), + ), + ); + } + + isServiceSelected(int serviceId) { + Iterable patientERHHCInsertServicesList = + widget + .patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList + .where((element) => serviceId == element.serviceID); + if (patientERHHCInsertServicesList.length > 0) { + return true; + } + return false; + } + + removeSelected(int serviceId) { + Iterable patientERHHCInsertServicesList = + widget + .patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList + .where((element) => serviceId == element.serviceID); + + if (patientERHHCInsertServicesList.length > 0) + setState(() { + widget + .patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList + .remove(patientERHHCInsertServicesList.first); + }); + } +} diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_three_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_three_page.dart new file mode 100644 index 00000000..aca2f3c2 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_three_page.dart @@ -0,0 +1,172 @@ +import 'dart:async'; + +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.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:google_maps_flutter/google_maps_flutter.dart'; + +class NewHomeHealthCareStepThreePage extends StatefulWidget { + final PatientERInsertPresOrderRequestModel + patientERInsertPresOrderRequestModel; + final Function changePageViewIndex; + final HomeHealthCareViewModel model; + + NewHomeHealthCareStepThreePage( + {Key key, + this.patientERInsertPresOrderRequestModel, + this.changePageViewIndex, + this.model}); + + @override + _NewHomeHealthCareStepThreePageState createState() => + _NewHomeHealthCareStepThreePageState(); +} + +class _NewHomeHealthCareStepThreePageState + extends State { + Completer _controller = Completer(); + + static CameraPosition _kGooglePlex = CameraPosition( + target: LatLng(37.42796133580664, -122.085749655962), + zoom: 14.4746, + ); + final Set markers = new Set(); + + @override + void initState() { + if (widget.patientERInsertPresOrderRequestModel.latitude != null) { + markers.clear(); + markers.add( + Marker( + markerId: MarkerId( + widget.patientERInsertPresOrderRequestModel.latitude.hashCode + .toString(), + ), + position: LatLng( + widget.patientERInsertPresOrderRequestModel.latitude, + widget.patientERInsertPresOrderRequestModel.longitude)), + ); + _kGooglePlex = CameraPosition( + target: LatLng(widget.patientERInsertPresOrderRequestModel.latitude, + widget.patientERInsertPresOrderRequestModel.longitude), + zoom: 14.4746, + ); + } + super.initState(); + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowDecPage: false, + baseViewModel: widget.model, + body: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Container( + width: double.maxFinite, + margin: EdgeInsets.only(left: 12, right: 12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts('Order Details'), + SizedBox( + height: 12, + ), + Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12)), + padding: EdgeInsets.all(8), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts('Location :'), + SizedBox( + height: 12, + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + height: 200, + child: GoogleMap( + mapType: MapType.normal, + markers: markers, + initialCameraPosition: _kGooglePlex, + onMapCreated: (GoogleMapController controller) { + _controller.complete(controller); + }, + ), + ), + ), + SizedBox( + height: 12, + ), + Texts('Selected Service :'), + ...List.generate( + widget.patientERInsertPresOrderRequestModel + .patientERHHCInsertServicesList.length, + (index) => Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + 'Service Name :', + fontSize: 12, + ), + SizedBox( + height: 5, + ), + Texts( + widget + .patientERInsertPresOrderRequestModel + .patientERHHCInsertServicesList[index] + .serviceName, + fontSize: 15, + bold: true, + ), + ], + ), + ), + ) + ], + ), + ), + SizedBox( + height: 57, + ), + ], + ), + ), + ), + bottomSheet: Container( + height: MediaQuery.of(context).size.height * 0.10, + width: double.infinity, + child: Column( + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.9, + child: SecondaryButton( + label: "Confirm", + disabled: widget.patientERInsertPresOrderRequestModel + .patientERHHCInsertServicesList.length == + 0, + onTap: () async { + await widget.model.insertPresPresOrder( + order: widget.patientERInsertPresOrderRequestModel); + if (widget.model.state != ViewState.ErrorLocal) { + widget.changePageViewIndex(0); + } + }, + textColor: Theme.of(context).backgroundColor), + ), + ], + ), + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_tow_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_tow_page.dart new file mode 100644 index 00000000..3f522a1f --- /dev/null +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_tow_page.dart @@ -0,0 +1,112 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.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/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/others/close_back.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:google_maps_place_picker/google_maps_place_picker.dart'; +import 'package:google_maps_flutter/google_maps_flutter.dart'; +import 'package:provider/provider.dart'; + +class NewHomeHealthCareStepTowPage extends StatefulWidget { + final Function(PickResult) onPick; + final double latitude; + final double longitude; + final PatientERInsertPresOrderRequestModel + patientERInsertPresOrderRequestModel; + final Function changePageViewIndex; + final HomeHealthCareViewModel model; + + const NewHomeHealthCareStepTowPage( + {Key key, + this.onPick, + this.latitude, + this.longitude, + this.patientERInsertPresOrderRequestModel, + this.changePageViewIndex, + this.model}) + : super(key: key); + + @override + _NewHomeHealthCareStepTowPageState createState() => + _NewHomeHealthCareStepTowPageState(); +} + +class _NewHomeHealthCareStepTowPageState + extends State { + double latitude = 0; + double longitude = 0; + + @override + void initState() { + if (widget.patientERInsertPresOrderRequestModel.latitude == null) { + latitude = widget.latitude; + longitude = widget.longitude; + } else { + latitude = widget.patientERInsertPresOrderRequestModel.latitude; + longitude = widget.patientERInsertPresOrderRequestModel.longitude; + } + super.initState(); + } + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return AppScaffold( + isShowDecPage: false, + body: PlacePicker( + apiKey: GOOGLE_API_KEY, + enableMyLocationButton: true, + automaticallyImplyAppBarLeading: false, + autocompleteOnTrailingWhitespace: true, + selectInitialPosition: true, + autocompleteLanguage: projectViewModel.currentLanguage, + enableMapTypeButton: true, + onPlacePicked: (PickResult result) { + print(result.adrAddress); + widget.changePageViewIndex(3); + }, + selectedPlaceWidgetBuilder: + (_, selectedPlace, state, isSearchBarFocused) { + print("state: $state, isSearchBarFocused: $isSearchBarFocused"); + return isSearchBarFocused + ? Container() + : FloatingCard( + bottomPosition: 0.0, + leftPosition: 0.0, + rightPosition: 0.0, + width: 500, + borderRadius: BorderRadius.circular(12.0), + child: state == SearchingState.Searching + ? Center(child: CircularProgressIndicator()) + : Container( + margin: EdgeInsets.all(12), + child: SecondaryButton( + color: Colors.grey[800], + textColor: Colors.white, + onTap: () { + setState(() { + widget.patientERInsertPresOrderRequestModel + .latitude = + selectedPlace.geometry.location.lat; + widget.patientERInsertPresOrderRequestModel + .longitude = + selectedPlace.geometry.location.lng; + }); + widget.changePageViewIndex(3); + }, + label: TranslationBase.of(context).next, + ), + ), + ); + }, + initialPosition: LatLng(latitude, longitude), + useCurrentLocation: true, + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_home_health_care_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_home_health_care_page.dart new file mode 100644 index 00000000..87a33c6d --- /dev/null +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_home_health_care_page.dart @@ -0,0 +1,325 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +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/viewModels/AlHabibMedicalService/home_health_care_view_model.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/Dialog/confirm_cancel_order_dialog.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_three_page.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_tow_page.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/material.dart'; +import 'package:geolocator/geolocator.dart'; + +import '../StepsWidget.dart'; +import 'new_Home_health_care_step_one_page.dart'; + +class NewHomeHealthCarePage extends StatefulWidget { + NewHomeHealthCarePage({this.model}); + + final HomeHealthCareViewModel model; + @override + _NewHomeHealthCarePageState createState() => _NewHomeHealthCarePageState(); +} + +class _NewHomeHealthCarePageState extends State + with TickerProviderStateMixin { + PageController _controller; + int _currentIndex = 1; + double _latitude; + double _longitude; + + PatientERInsertPresOrderRequestModel patientERInsertPresOrderRequestModel = + new PatientERInsertPresOrderRequestModel(); + + @override + void initState() { + super.initState(); + _controller = new PageController(); + _getCurrentLocation(); + } + + _getCurrentLocation() async { + await getLastKnownPosition().then((value) { + _latitude = value.latitude; + _longitude = value.longitude; + }).catchError((e) { + _longitude = 0; + _latitude = 0; + }); + } + + @override + void dispose() { + super.dispose(); + } + + _changeCurrentTab(int tab) { + setState(() { + _currentIndex = tab; + }); + _controller.animateToPage(tab, + duration: Duration(milliseconds: 800), curve: Curves.easeOutQuart); + } + + @override + Widget build(BuildContext context) { + void showConfirmMessage(HomeHealthCareViewModel model, + GetOrderDetailByOrderIDResponseModel order) { + showDialog( + context: context, + child: ConfirmCancelOrderDialog( + model: model, + onTap: () async { + UpdatePresOrderRequestModel updatePresOrderRequestModel = + UpdatePresOrderRequestModel( + presOrderID: order.presOrderID, + rejectionReason: "", + presOrderStatus: 4, + editedBy: 3); + await model.updateHHCPresOrder(updatePresOrderRequestModel); + if (model.state == ViewState.ErrorLocal) { + Utils.showErrorToast(model.error); + } else { + AppToast.showSuccessToast(message: "Done Successfully"); + await model.getHHCAllPresOrders(); + // await model.getHHCAllServices(); + } + }, + )); + } + + return Scaffold( + body: SafeArea( + child: SingleChildScrollView( + child: Container( + height: MediaQuery.of(context).size.height * 0.8, + child: Column( + children: [ + + Container( + margin: EdgeInsets.only(left: MediaQuery.of(context).size.width*0.05, right: MediaQuery.of(context).size.width*0.05), + child: StepsWidget( + index: _currentIndex, + changeCurrentTab: _changeCurrentTab, + ), + ), + Expanded( + child: PageView( + physics: NeverScrollableScrollPhysics(), + controller: _controller, + onPageChanged: (index) { + setState(() { + _currentIndex = index; + }); + }, + scrollDirection: Axis.horizontal, + children: [ + widget.model.pendingOrder != null + ? FractionallySizedBox( + widthFactor: 0.9, + child: SingleChildScrollView( + child: Container( + width: double.infinity, + margin: EdgeInsets.only(top: 15), + decoration: BoxDecoration( + border: Border.all(color: Colors.grey, width: 1), + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 12, + ), + Container( + width: double.infinity, + padding: EdgeInsets.only( + left: 15, bottom: 15, top: 15), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Colors.grey, + width: 1.0, + ), + ), + // borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + "Request ID", + bold: false, + fontSize: 13, + ), + SizedBox( + height: 4, + ), + Texts( + widget.model.pendingOrder.iD.toString(), + fontSize: 22, + ), + ], + ), + ), + Container( + width: double.infinity, + padding: EdgeInsets.only( + left: 15, bottom: 15, top: 15), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Colors.grey, + width: 1.0, + ), + ), + // borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + "Status", + bold: false, + fontSize: 13, + ), + SizedBox( + height: 4, + ), + Texts( + widget.model.pendingOrder.description, + fontSize: 22, + ), + ], + ), + ), + Container( + width: double.infinity, + padding: EdgeInsets.only( + left: 15, bottom: 15, top: 15), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Colors.grey, + width: 1.0, + ), + ), + // borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + "Pickup Date", + bold: false, + fontSize: 13, + ), + SizedBox( + height: 4, + ), + Texts( + DateUtil.getDayMonthYearDateFormatted( + DateUtil.convertStringToDate(widget + .model.pendingOrder.createdOn)), + fontSize: 22, + ), + ], + ), + ), + ...List.generate( + widget.model.hhcAllOrderDetail.length, + (index) => Container( + width: double.infinity, + padding: EdgeInsets.only( + left: 15, bottom: 15, top: 15), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Colors.grey, + width: 1.0, + ), + ), + // borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + "Service Name", + bold: false, + fontSize: 13, + ), + SizedBox( + height: 4, + ), + Texts( + widget.model.hhcAllOrderDetail[index] + .description, + fontSize: 22, + bold: true, + ), + ], + ), + ), + ), + SizedBox( + height: 12, + ), + Center( + child: Container( + width: + MediaQuery.of(context).size.width * 0.85, + child: SecondaryButton( + label: "Cancel".toUpperCase(), + onTap: () { + showConfirmMessage(widget.model, + widget.model.hhcAllOrderDetail[0]); + }, + color: Colors.red[800], + disabled: false, + textColor: + Theme.of(context).backgroundColor), + ), + ), + SizedBox( + height: 12, + ), + ], + ), + ), + ), + ) + : NewHomeHealthCareStepOnePage( + changePageViewIndex: _changeCurrentTab, + patientERInsertPresOrderRequestModel: patientERInsertPresOrderRequestModel, + model: widget.model, + ), + NewHomeHealthCareStepTowPage( + latitude: _latitude, + longitude: _longitude, + changePageViewIndex: _changeCurrentTab, + patientERInsertPresOrderRequestModel: patientERInsertPresOrderRequestModel, + model: widget.model, + ), + NewHomeHealthCareStepThreePage( + changePageViewIndex: _changeCurrentTab, + patientERInsertPresOrderRequestModel: patientERInsertPresOrderRequestModel, + model: widget.model, + ) + + ], + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/StepsWidget.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/StepsWidget.dart new file mode 100644 index 00000000..370544d0 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/StepsWidget.dart @@ -0,0 +1,181 @@ +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.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 StepsWidget extends StatelessWidget { + final int index; + final Function changeCurrentTab; + + StepsWidget({Key key, this.index, this.changeCurrentTab}); + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return !projectViewModel.isArabic? Stack( + children: [ + Container( + height: 50, + width: MediaQuery.of(context).size.width, + color: Colors.transparent, + child: Center( + child: Divider( + color: Colors.grey, + height: 0.75, + thickness: 0.75, + ), + ), + ), + Positioned( + top: 10, + left: 0, + child: InkWell( + onTap: () => changeCurrentTab(0), + child: Container( + width: 35, + height: 35, + decoration: BoxDecoration( + border: index > 0 ? null:Border.all(color: Colors.black,width: 0.75), + shape: BoxShape.circle, + color: index == 0 ? Colors.grey[800] : index > 0 ?Colors.green: Colors.white, + ), + child: Center( + child: Texts( + '1', + color: index == 0 ? Colors.white : index > 0 ?Colors.white: Colors.grey[800], + ), + ), + ), + ), + ), + Positioned( + top: 10, + left: MediaQuery.of(context).size.width * 0.42, + child: InkWell( + onTap: () => index >= 2 ? changeCurrentTab(1) : null, + child: Container( + width: 35, + height: 35, + decoration: BoxDecoration( + border: index > 1 ? null:Border.all(color: Colors.black,width: 0.75), + shape: BoxShape.circle, + color: index == 1 ? Colors.grey[800] : index > 1 ?Colors.green: Colors.white, + ), + child: Center( + child: Texts( + '2', + color: index == 1? Colors.white : index > 1 ?Colors.white: Colors.grey[800], + ), + ), + ), + ), + ), + Positioned( + top: 10, + right: 0, + child: InkWell( + onTap: () => index == 2 ?changeCurrentTab(3) : null, + child: Container( + width: 35, + height: 35, + decoration: BoxDecoration( + shape: BoxShape.circle, + border: Border.all(color: Colors.black,width: 0.75), + color: index == 2 ? Colors.grey[800] : Colors.white, + ), + child: Center( + child: Texts( + '3', + color: index == 2 ? Colors.white : Colors.grey[800], + ), + ), + ), + ), + ), + + ], + ):Stack( + children: [ + Container( + height: 50, + width: MediaQuery.of(context).size.width, + color: Colors.transparent, + child: Center( + child: Divider( + color: Colors.grey, + height: 0.75, + thickness: 0.75, + ), + ), + ), + Positioned( + top: 10, + right: 0, + child: InkWell( + onTap: () => changeCurrentTab(0), + child: Container( + width: 35, + height: 35, + decoration: BoxDecoration( + border: index > 0 ? null:Border.all(color: Colors.black,width: 0.75), + shape: BoxShape.circle, + color: index == 0 ? Colors.grey[800] : index > 0 ?Colors.green: Colors.white, + ), + child: Center( + child: Texts( + '1', + color: index == 0 ? Colors.white : index > 0 ?Colors.white: Colors.grey[800], + ), + ), + ), + ), + ), + Positioned( + top: 10, + left: MediaQuery.of(context).size.width * 0.42, + child: InkWell( + onTap: () => index >= 2 ? changeCurrentTab(1) : null, + child: Container( + width: 35, + height: 35, + decoration: BoxDecoration( + border: index > 1 ? null:Border.all(color: Colors.black,width: 0.75), + shape: BoxShape.circle, + color: index == 1 ? Colors.grey[800] : index > 1 ?Colors.green: Colors.white, + ), + child: Center( + child: Texts( + '2', + color: index == 1? Colors.white : index > 1 ?Colors.white: Colors.grey[800], + ), + ), + ), + ), + ), + Positioned( + top: 10, + left: 0, + child: InkWell( + onTap: () => index == 2 ?changeCurrentTab(3) : null, + child: Container( + width: 35, + height: 35, + decoration: BoxDecoration( + shape: BoxShape.circle, + border: Border.all(color: Colors.black,width: 0.75), + color: index == 2 ? Colors.grey[800] : Colors.white, + ), + child: Center( + child: Texts( + '3', + color: index == 2 ? Colors.white : Colors.grey[800], + ), + ), + ), + ), + ), + ], + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_index_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_index_page.dart new file mode 100644 index 00000000..fa0799f9 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_index_page.dart @@ -0,0 +1,69 @@ +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:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; + +import 'home_health_care_page.dart'; + +class HomeHealthCareIndexPage extends StatelessWidget { + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).serviceInformation, + body: SingleChildScrollView( + padding: EdgeInsets.all(12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + TranslationBase.of(context).homeHealthCare, + fontWeight: FontWeight.normal, + fontSize: 25, + color: Color(0xff60686b), + ), + SizedBox( + height: 12, + ), + Texts( + TranslationBase.of(context).homeHealthCareText, + fontWeight: FontWeight.normal, + fontSize: 17, + ), + SizedBox( + height: 22, + ), + Center( + child: Image.asset( + 'assets/images/AlHabibMedicalService/Wifi-AR.png')), + SizedBox( + height: 77, + ), + ], + )), + bottomSheet: Container( + height: MediaQuery.of(context).size.height * 0.10, + width: double.infinity, + child: Column( + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.9, + child: SecondaryButton( + onTap: () => Navigator.push( + context, + FadePage( + page: HomeHealthCarePage(), + ), + ), + label: TranslationBase.of(context).loginRegister, + textColor: Theme.of(context).backgroundColor), + ), + ], + ), + )); + } +} diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_page.dart new file mode 100644 index 00000000..8f4821f6 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_page.dart @@ -0,0 +1,132 @@ +import 'dart:ui'; + +import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/all_habib_medical_services/e_referral_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'NewHomeHealthCare/new_home_health_care_page.dart'; +import 'orders_log_details_page.dart'; + +class HomeHealthCarePage extends StatefulWidget { + @override + _HomeHealthCarePageState createState() => _HomeHealthCarePageState(); +} + +class _HomeHealthCarePageState extends State + with SingleTickerProviderStateMixin { + TabController _tabController; + + @override + void initState() { + super.initState(); + _tabController = TabController(length: 2, vsync: this); + } + + @override + void dispose() { + super.dispose(); + _tabController.dispose(); + } + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model){ + // model.getHHCAllServices(); + model.getHHCAllPresOrders(); + }, + builder: (_, model, widget) => AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).homeHealthCare, + 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.9, + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Theme.of(context).dividerColor, + width: 0.7), + ), + color: Colors.white), + child: Center( + child: TabBar( + 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], + tabs: [ + Container( + width: MediaQuery.of(context).size.width * 0.37, + child: Center( + child: Texts(TranslationBase.of(context).homeHealthCare), + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.37, + child: Center( + child: Texts(TranslationBase.of(context).orderLog), + ), + ), + ], + ), + ), + ), + ), + ], + ), + ), + body: Column( + children: [ + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + NewHomeHealthCarePage( + model: model, + ), + OrdersLogDetailsPage( + model: model, + ) + ], + ), + ) + ], + ), + ), + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart new file mode 100644 index 00000000..0cfedb41 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart @@ -0,0 +1,251 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_hhc_all_pres_orders_response_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/utils.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/material.dart'; + +import 'Dialog/confirm_cancel_order_dialog.dart'; + +class OrdersLogDetailsPage extends StatelessWidget { + final HomeHealthCareViewModel model; + + const OrdersLogDetailsPage({Key key, this.model}) : super(key: key); + + @override + Widget build(BuildContext context) { + void showConfirmMessage( + HomeHealthCareViewModel model, GetHHCAllPresOrdersResponseModel order) { + showDialog( + context: context, + child: ConfirmCancelOrderDialog( + model: model, + onTap: () async { + UpdatePresOrderRequestModel updatePresOrderRequestModel = + UpdatePresOrderRequestModel( + presOrderID: order.iD, + rejectionReason: "", + presOrderStatus: 4, editedBy: 3); + await model.updateHHCPresOrder(updatePresOrderRequestModel); + if(model.state == ViewState.ErrorLocal) { + Utils.showErrorToast(model.error); + } else { + AppToast.showSuccessToast(message: "Done Successfully"); + await model.getHHCAllPresOrders(); + // await model.getHHCAllServices(); + } + }, + )); + } + + return AppScaffold( + isShowAppBar: false, + baseViewModel: model, + body: SingleChildScrollView( + physics: ScrollPhysics(), + child: Container( + margin: EdgeInsets.all(12), + child: Center( + child: FractionallySizedBox( + widthFactor: 0.94, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 50, + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: model.hhcAllPresOrders.map((order) { + return Container( + width: double.infinity, + margin: EdgeInsets.only(top: 15), + decoration: BoxDecoration( + border: + Border.all(color: Colors.grey, width: 1), + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 12, + ), + Container( + width: double.infinity, + padding: EdgeInsets.only( + left: 15, bottom: 15, top: 15), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Colors.grey, + width: 1.0, + ), + ), + // borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + "Request ID", + bold: false, + fontSize: 13, + ), + SizedBox( + height: 4, + ), + Texts( + order.iD.toString(), + fontSize: 22, + ), + ], + ), + ), + Container( + width: double.infinity, + padding: EdgeInsets.only( + left: 15, bottom: 15, top: 15), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Colors.grey, + width: 1.0, + ), + ), + // borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + "Status", + bold: false, + fontSize: 13, + ), + SizedBox( + height: 4, + ), + Texts( + order.description, + fontSize: 22, + ), + ], + ), + ), + Container( + width: double.infinity, + padding: EdgeInsets.only( + left: 15, bottom: 15, top: 15), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Colors.grey, + width: 1.0, + ), + ), + // borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + "Pickup Date", + bold: false, + fontSize: 13, + ), + SizedBox( + height: 4, + ), + Texts( + DateUtil.getDayMonthYearDateFormatted( + DateUtil.convertStringToDate( + order.createdOn)), + fontSize: 22, + ), + ], + ), + ), + Container( + width: double.infinity, + padding: EdgeInsets.only( + left: 15, bottom: 15, top: 15), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Colors.grey, + width: 1.0, + ), + ), + // borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + "Location", + bold: false, + fontSize: 13, + ), + SizedBox( + height: 4, + ), + Texts( + order.nearestProjectDescription + .toString() ?? + order.nearestProjectDescriptionN + .toString(), + fontSize: 22, + ), + ], + ), + ), + SizedBox( + height: 12, + ), + if (order.status == 1 ||order.status == 2 ) + Center( + child: Container( + width: MediaQuery + .of(context) + .size + .width * + 0.85, + child: SecondaryButton( + label: "Cancel".toUpperCase(), + onTap: () { + showConfirmMessage(model, order); + } + , + color: Colors.red[800], + disabled: false, + textColor: Theme + .of(context) + .backgroundColor), + ), + ), + SizedBox( + height: 12, + ), + ], + ), + ); + }).toList()) + ], + ), + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart index f717ba8e..ea98921d 100644 --- a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart +++ b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart @@ -1,35 +1,32 @@ +import 'package:diplomaticquarterapp/config/shared_pref_kay.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/%E2%80%8B%20health_calculators.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'; -import 'package:diplomaticquarterapp/pages/Blood/advance_payment_page.dart'; import 'package:diplomaticquarterapp/pages/Blood/blood_donation.dart'; - import 'package:diplomaticquarterapp/pages/BookAppointment/BookingOptions.dart'; import 'package:diplomaticquarterapp/pages/ChildVaccines/child_vaccines_page.dart'; import 'package:diplomaticquarterapp/pages/ErService/ErOptions.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart'; import 'package:diplomaticquarterapp/pages/family/my-family.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart'; - import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart'; import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.dart'; 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/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/services)contaniner.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/widgets/data_display/services)contaniner.dart'; -import 'package:flutter_inappwebview/flutter_inappwebview.dart'; import 'package:url_launcher/url_launcher.dart'; -import 'package:webview_flutter/webview_flutter.dart'; - -import 'h2o/h2o_page.dart'; class AllHabibMedicalService extends StatefulWidget { @override @@ -37,6 +34,17 @@ class AllHabibMedicalService extends StatefulWidget { } class _AllHabibMedicalServiceState extends State { + AppSharedPreferences sharedPref = AppSharedPreferences(); + AuthenticatedUser authUser = new AuthenticatedUser(); + + @override + void initState() { + WidgetsBinding.instance.addPostFrameCallback((timeStamp) { + getAuthUser(); + }); + super.initState(); + } + @override Widget build(BuildContext context) { return AppScaffold( @@ -177,7 +185,10 @@ class _AllHabibMedicalServiceState extends State { ServicesContainer( onTap: () => Navigator.push( context, - FadePage(page: EReferralIndexPage()), + FadePage( + page: authUser.patientID == null + ? EReferralIndexPage() + : EReferralPage()), ), imageLocation: 'assets/images/ereferral_service_icon.png', title: 'E-Referral', @@ -214,8 +225,9 @@ class _AllHabibMedicalServiceState extends State { title: TranslationBase.of(context).todoList, ), ServicesContainer( - onTap: () => Navigator.of(context).pushNamed( - SYMPTOM_CHECKER, + onTap: () => Navigator.push( + context, + FadePage(page: SymptomInfo()), ), imageLocation: 'assets/images/new-design/body_icon.png', title: 'Symptom Checker'), @@ -315,4 +327,15 @@ class _AllHabibMedicalServiceState extends State { ), ); } + + getAuthUser() async { + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + setState(() { + authUser = data; + }); + print(authUser.patientID); + } + } } diff --git a/lib/pages/AlHabibMedicalService/h2o/Dialog/confirm_add_amount_dialog.dart b/lib/pages/AlHabibMedicalService/h2o/Dialog/confirm_add_amount_dialog.dart index 2b2873e4..90386827 100644 --- a/lib/pages/AlHabibMedicalService/h2o/Dialog/confirm_add_amount_dialog.dart +++ b/lib/pages/AlHabibMedicalService/h2o/Dialog/confirm_add_amount_dialog.dart @@ -1,4 +1,4 @@ -import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/insert_user_activity_request_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/insert_user_activity_request_model.dart'; import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; diff --git a/lib/pages/AlHabibMedicalService/h2o/h2o_index_page.dart b/lib/pages/AlHabibMedicalService/h2o/h2o_index_page.dart index 68ce1936..e6e05ee6 100644 --- a/lib/pages/AlHabibMedicalService/h2o/h2o_index_page.dart +++ b/lib/pages/AlHabibMedicalService/h2o/h2o_index_page.dart @@ -1,6 +1,6 @@ import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/h2o_page.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/CarouselSlider.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'; @@ -13,61 +13,57 @@ class H2OPageIndexPage extends StatelessWidget { Widget build(BuildContext context) { return AppScaffold( isShowAppBar: true, - appBarTitle: "Service Information", + appBarTitle: TranslationBase.of(context).serviceInformation, body: SingleChildScrollView( padding: EdgeInsets.all(12), child: Column( crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - "Water Tracker:", - fontWeight: FontWeight.normal, - fontSize: 25, - color: HexColor("#60686b"), - ), - SizedBox( - height: 12, - ), - Texts( - "This service is designed to help you to set drinking water goals and track the volume of water you are drinking on a daily basis. This service allows for schedule reminders and offers a basic statistical analysis of the amount of what you have consumed over the course of a day, week or month.", - fontWeight: FontWeight.normal, - fontSize: 17, - ), - SizedBox( - height: 22, - ), - Center( - child: SizedBox( - height: MediaQuery.of(context).size.height * 0.55, - width: MediaQuery.of(context).size.width * 0.50, - child: CarouselSlider( - imagesUrlList: [ - "https://hmgwebservices.com/Images/MobileApp/images-info-home/referal/en/0.png", - "https://hmgwebservices.com/Images/MobileApp/images-info-home/referal/en/1.png" - ], - ), - ), - ), - SizedBox( - height: 77, - ), - ], - )), + children: [ + Texts( + "Water Tracker:", + fontWeight: FontWeight.normal, + fontSize: 25, + color: HexColor("#60686b"), + ), + SizedBox( + height: 12, + ), + Texts( + "This service is designed to help you to set drinking water goals and track the volume of water you are drinking on a daily basis. This service allows for schedule reminders and offers a basic statistical analysis of the amount of what you have consumed over the course of a day, week or month.", + fontWeight: FontWeight.normal, + fontSize: 17, + ), + SizedBox( + height: 22, + ), + Center( + child: Image.asset( + 'assets/images/AlHabibMedicalService/Wifi-AR.png')), + SizedBox( + height: 77, + ), + ], + )), bottomSheet: Container( height: MediaQuery.of(context).size.height * 0.10, width: double.infinity, child: Column( children: [ Container( - width: MediaQuery.of(context).size.width * 0.9, + width: MediaQuery + .of(context) + .size + .width * 0.9, child: SecondaryButton( onTap: () => Navigator.push(context, FadePage(page: H2OPage())), label: "Water Tracker", - textColor: Theme.of(context).backgroundColor), + textColor: Theme + .of(context) + .backgroundColor), ), ], ), - )); + ),); } } diff --git a/lib/pages/AlHabibMedicalService/h2o/widgets/h20_floating_action_button.dart b/lib/pages/AlHabibMedicalService/h2o/widgets/h20_floating_action_button.dart index a2fa1adf..7eaed1a8 100644 --- a/lib/pages/AlHabibMedicalService/h2o/widgets/h20_floating_action_button.dart +++ b/lib/pages/AlHabibMedicalService/h2o/widgets/h20_floating_action_button.dart @@ -1,6 +1,6 @@ import 'dart:math' as math; -import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/insert_user_activity_request_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/insert_user_activity_request_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/Dialog/confirm_add_amount_dialog.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; diff --git a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart index 74cba568..3e9ae0cd 100644 --- a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart +++ b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart @@ -235,7 +235,7 @@ class _DocAvailableAppointmentsState extends State return children; }, ), - onDaySelected: (date, events,holidays) { + onDaySelected: (date, events,format) { _onDaySelected(date, events); _animationController.forward(from: 0.0); }, @@ -385,8 +385,8 @@ class _DocAvailableAppointmentsState extends State color: _calendarController.isSelected(date) ? Colors.green[400] : _calendarController.isToday(date) - ? Colors.brown[300] - : Colors.blue[400], + ? Colors.brown[300] + : Colors.blue[400], ), width: 40.0, height: 40.0, diff --git a/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart b/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart index 264f828a..9f2418fd 100644 --- a/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart +++ b/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart @@ -348,8 +348,8 @@ class _CovidTimeSlotsState extends State return children; }, ), - onDaySelected: (date, events,holidays) { - _onDaySelected(date, events); + onDaySelected: (date, event,formats) { + _onDaySelected(date, event,); _animationController.forward(from: 0.0); }, onVisibleDaysChanged: _onVisibleDaysChanged, diff --git a/lib/pages/ErService/AmbulanceReq.dart b/lib/pages/ErService/AmbulanceReq.dart index ec96f482..413d80e6 100644 --- a/lib/pages/ErService/AmbulanceReq.dart +++ b/lib/pages/ErService/AmbulanceReq.dart @@ -3,6 +3,9 @@ import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_ import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_history_page.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_page.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/others/OrderLogItem.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'dart:ui'; @@ -66,7 +69,7 @@ class _AmbulanceReqState extends State child: Container( height: 60.0, margin: EdgeInsets.only(top: 10.0), - width: MediaQuery.of(context).size.width * 0.9, + width: MediaQuery.of(context).size.width * 0.93, decoration: BoxDecoration( border: Border( bottom: BorderSide( @@ -114,9 +117,7 @@ class _AmbulanceReqState extends State physics: BouncingScrollPhysics(), controller: _tabController, children: [ - model.hasPendingOrder - ? Container() - : AmbulanceRequestIndexPage( + AmbulanceRequestIndexPage( amRequestViewModel: model, ), OrderLogPage( diff --git a/lib/pages/ErService/AmbulanceRequestIndexPages/AmbulanceRequestIndex.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/AmbulanceRequestIndex.dart index 55e75e22..5f303846 100644 --- a/lib/pages/ErService/AmbulanceRequestIndexPages/AmbulanceRequestIndex.dart +++ b/lib/pages/ErService/AmbulanceRequestIndexPages/AmbulanceRequestIndex.dart @@ -1,8 +1,13 @@ import 'package:diplomaticquarterapp/core/model/er/PatientER.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; import 'package:diplomaticquarterapp/pages/ErService/widgets/StepsWidget.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/others/OrderLogItem.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; import 'BillAmount.dart'; import 'PickupLocation.dart'; @@ -15,7 +20,8 @@ class AmbulanceRequestIndexPage extends StatefulWidget { AmbulanceRequestIndexPage({Key key, this.amRequestViewModel}); @override - _AmbulanceRequestIndexPageState createState() => _AmbulanceRequestIndexPageState(); + _AmbulanceRequestIndexPageState createState() => + _AmbulanceRequestIndexPageState(); } class _AmbulanceRequestIndexPageState extends State { @@ -40,48 +46,124 @@ class _AmbulanceRequestIndexPageState extends State { @override Widget build(BuildContext context) { return AppScaffold( - body: Column( - children: [ - SizedBox( - height: 80, - ), - Container( - margin: EdgeInsets.only(left: 12, right: 12), - child: StepsWidget( - index: currentIndex, - changeCurrentTab: _changeCurrentTab, - )), - Expanded( - child: PageView( - physics: NeverScrollableScrollPhysics(), - controller: pageController, - children: [ - //Container(), - SelectTransportationMethod( - changeCurrentTab: _changeCurrentTab, - patientER: _patientER, - amRequestViewModel: widget.amRequestViewModel, + body: widget.amRequestViewModel.pickUpRequestPresOrder != null + ? Column( + children: [ + SizedBox( + height: 80, ), - PickupLocation( - changeCurrentTab: _changeCurrentTab, - patientER: _patientER, - amRequestViewModel: widget.amRequestViewModel, + Container( + margin: EdgeInsets.only(left: 18, right: 18), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(2), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + OrderLogItem( + title: 'Request ID', + value: widget.amRequestViewModel.pickUpRequestPresOrder + .presOrderID + .toString(), + ), + OrderLogItem( + title: 'Status', + value: widget.amRequestViewModel.pickUpRequestPresOrder + .ambulateDescription, + ), + OrderLogItem( + title: 'Last edit time', + value: DateUtil.getDayMonthYearDateFormatted( + DateUtil.convertStringToDate(widget + .amRequestViewModel + .pickUpRequestPresOrder + .lastEditDate)), + ), + OrderLogItem( + title: 'Pickup Location', + value: widget.amRequestViewModel.pickUpRequestPresOrder + .pickupLocationName, + ), + OrderLogItem( + title: 'Drop off Location', + value: widget.amRequestViewModel.pickUpRequestPresOrder + .dropoffLocationName, + ), + OrderLogItem( + title: 'Trasfaer way', + value: widget + .amRequestViewModel.pickUpRequestPresOrder.title, + ), + Container( + padding: EdgeInsets.all(10), + width: double.maxFinite, + margin: EdgeInsets.only(bottom: 4, left: 4, right: 4), + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + bottomRight: Radius.circular(12), + bottomLeft: Radius.circular(12), + ), + color: Colors.white), + child: SecondaryButton( + color: Colors.red[900], + textColor: Colors.white, + label: TranslationBase.of(context).cancel, + onTap: () { + widget.amRequestViewModel.updatePressOrder( + presOrderID: widget.amRequestViewModel + .pickUpRequestPresOrder.presOrderID); + }, + ), + ) + ], + ), ), - BillAmount( - changeCurrentTab: _changeCurrentTab, - patientER: _patientER, - amRequestViewModel: widget.amRequestViewModel, + ], + ) + : Column( + children: [ + SizedBox( + height: 80, + ), + Container( + margin: EdgeInsets.only(left: 12, right: 12), + child: StepsWidget( + index: currentIndex, + changeCurrentTab: _changeCurrentTab, + ), ), - Summary( - changeCurrentTab: _changeCurrentTab, - patientER: _patientER, - amRequestViewModel: widget.amRequestViewModel, + Expanded( + child: PageView( + physics: NeverScrollableScrollPhysics(), + controller: pageController, + children: [ + //Container(), + SelectTransportationMethod( + changeCurrentTab: _changeCurrentTab, + patientER: _patientER, + amRequestViewModel: widget.amRequestViewModel, + ), + PickupLocation( + changeCurrentTab: _changeCurrentTab, + patientER: _patientER, + amRequestViewModel: widget.amRequestViewModel, + ), + BillAmount( + changeCurrentTab: _changeCurrentTab, + patientER: _patientER, + amRequestViewModel: widget.amRequestViewModel, + ), + Summary( + changeCurrentTab: _changeCurrentTab, + patientER: _patientER, + amRequestViewModel: widget.amRequestViewModel, + ), + ], + ), ), ], ), - ), - ], - ), ); } } diff --git a/lib/pages/ErService/AmbulanceRequestIndexPages/PickupLocation.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/PickupLocation.dart index 795f4dcc..b99596c8 100644 --- a/lib/pages/ErService/AmbulanceRequestIndexPages/PickupLocation.dart +++ b/lib/pages/ErService/AmbulanceRequestIndexPages/PickupLocation.dart @@ -8,8 +8,10 @@ import 'package:diplomaticquarterapp/pages/ErService/widgets/AppointmentCard.dar import 'package:diplomaticquarterapp/pages/landing/home_page.dart'; import 'package:diplomaticquarterapp/uitl/ProgressDialog.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/pickupLocation/PickupLocationFromMap.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -61,7 +63,6 @@ class _PickupLocationState extends State { _longitude = 0; _latitude = 0; }); - // currentLocation = LatLng(position.latitude, position.longitude); } @override @@ -81,24 +82,42 @@ class _PickupLocationState extends State { SizedBox( height: 15, ), - Container( - padding: EdgeInsets.all(12), - decoration: BoxDecoration( - shape: BoxShape.rectangle, - borderRadius: BorderRadius.circular(8), - border: Border.all(color: Colors.grey, width: 0.5), - color: Colors.white, - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Texts('Select From Map'), - Icon( - FontAwesomeIcons.mapMarkerAlt, - size: 24, - color: Colors.black, - ) - ], + InkWell( + onTap: (){ + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => PickupLocationFromMap( + latitude: _latitude, + longitude: _longitude, + onPick: (value) { + setState(() { + _result = value; + }); + }, + ), + ), + ); + }, + child: Container( + padding: EdgeInsets.all(12), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(getSelectFromMapName()), + Icon( + FontAwesomeIcons.mapMarkerAlt, + size: 24, + color: Colors.black, + ) + ], + ), ), ), SizedBox( @@ -263,7 +282,7 @@ class _PickupLocationState extends State { ), ], ), - if (widget.patientER.direction == 1) + if (widget.patientER.direction == 0) Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -309,18 +328,14 @@ class _PickupLocationState extends State { Navigator.push( context, MaterialPageRoute( - builder: (context) => PlacePicker( - apiKey: 'AIzaSyCiD4YqVqLNYbt8-htvFy4Wp8XSph9E3wM​', - // Put YOUR OWN KEY here. - onPlacePicked: (PickResult result) { - print(result.adrAddress); + builder: (context) => PickupLocationFromMap( + latitude: _latitude, + longitude: _longitude, + onPick: (value) { setState(() { - _result = result; + _result = value; }); - Navigator.of(context).pop(); }, - initialPosition: LatLng(_latitude, _longitude), - useCurrentLocation: true, ), ), ); @@ -336,7 +351,7 @@ class _PickupLocationState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Texts('Select From Map'), + Texts(getSelectFromMapName()), Icon( FontAwesomeIcons.mapMarkerAlt, size: 24, @@ -348,7 +363,6 @@ class _PickupLocationState extends State { ), ], ), - //TODO show dialog projects SizedBox( height: 45, @@ -361,44 +375,57 @@ class _PickupLocationState extends State { color: Colors.grey[800], textColor: Colors.white, onTap: () { - if(_result==null || _selectedHospital == null) - AppToast.showErrorToast(message: 'please select all fields'); + if (_result == null || _selectedHospital == null) + AppToast.showErrorToast( + message: 'please select all fields'); else - setState(() { - widget.patientER.pickupSpot = _isInsideHome ? 1 : 0; - if (widget.patientER.direction == 0) { - widget.patientER.pickupLocationLattitude = _result.geometry.location.lat.toString(); - widget.patientER.pickupLocationLongitude = _result.geometry.location.lng.toString(); - widget.patientER.dropoffLocationLattitude = _selectedHospital.latitude; - widget.patientER.dropoffLocationLongitude = _selectedHospital.longitude; - - } else { - widget.patientER.pickupLocationLattitude = _selectedHospital.latitude; - widget.patientER.pickupLocationLongitude = _selectedHospital.longitude; - widget.patientER.dropoffLocationLattitude = _result.geometry.location.lat.toString(); - widget.patientER.dropoffLocationLongitude = _result.geometry.location.lng.toString(); - } + setState(() { + widget.patientER.pickupSpot = _isInsideHome ? 1 : 0; + if (widget.patientER.direction == 0) { + widget.patientER.pickupLocationLattitude = _result.geometry.location.lat.toString(); + widget.patientER.pickupLocationLongitude = _result.geometry.location.lng.toString(); + widget.patientER.dropoffLocationLattitude = _selectedHospital.latitude; + widget.patientER.dropoffLocationLongitude = _selectedHospital.longitude; + } else { + widget.patientER.pickupLocationLattitude = _selectedHospital.latitude; + widget.patientER.pickupLocationLongitude = _selectedHospital.longitude; + widget.patientER.dropoffLocationLattitude = _result.geometry.location.lat.toString(); + widget.patientER.dropoffLocationLongitude = _result.geometry.location.lng.toString(); + } - widget.patientER.latitude = widget.patientER.pickupLocationLattitude; - widget.patientER.longitude = widget.patientER.pickupLocationLongitude; + widget.patientER.latitude = widget.patientER.pickupLocationLattitude; + widget.patientER.longitude = widget.patientER.pickupLocationLongitude; + widget.patientER.dropoffLocationName = _selectedHospital.name; + widget.patientER.createdBy = widget.amRequestViewModel.user.patientID; + widget.patientER.isOutPatient = widget.amRequestViewModel.user.outSA; + widget.patientER.patientIdentificationID = widget.amRequestViewModel.user.patientIdentificationNo; + widget.patientER.pickupDateTime = DateUtil.convertDateToStringLocation(DateTime.now()); + widget.patientER.pickupLocationName = _result.formattedAddress; + widget.patientER.projectID = widget.amRequestViewModel.user.projectID; + widget.patientER.requesterFileNo = widget.amRequestViewModel.user.patientID; + widget.patientER.requesterIsOutSA = false; + widget.patientER.lineItemNo =0; + widget.patientER.requesterMobileNo = widget.amRequestViewModel.user.mobileNumber; - if(_haveAppointment == HaveAppointment.YES){ - widget.patientER.appointmentNo = myAppointment.appointmentNo.toString(); - widget.patientER.appointmentClinicName = myAppointment.clinicName; - widget.patientER.appointmentDoctorName = myAppointment.doctorNameObj; - widget.patientER.appointmentBranch = myAppointment.projectName; - widget.patientER.appointmentTime = myAppointment.appointmentDate; - }else{ - widget.patientER.appointmentNo ="0"; - widget.patientER.appointmentClinicName = null; - widget.patientER.appointmentDoctorName = null; - widget.patientER.appointmentBranch = null; - widget.patientER.appointmentTime = null; - } + if (_haveAppointment == HaveAppointment.YES) { + widget.patientER.appointmentNo = myAppointment.appointmentNo.toString(); + widget.patientER.appointmentClinicName = myAppointment.clinicName; + widget.patientER.appointmentDoctorName = myAppointment.doctorNameObj; + widget.patientER.appointmentBranch = myAppointment.projectName; + widget.patientER.appointmentTime = myAppointment.appointmentDate; + widget.patientER.haveAppointment = true; + } else { + widget.patientER.appointmentNo = "0"; + widget.patientER.appointmentClinicName = null; + widget.patientER.appointmentDoctorName = null; + widget.patientER.appointmentBranch = null; + widget.patientER.appointmentTime = null; + widget.patientER.haveAppointment = false; + } - widget.patientER.pickupSpot = _isInsideHome ? 1 : 0; - widget.changeCurrentTab(2); - }); + widget.patientER.pickupSpot = _isInsideHome ? 1 : 0; + widget.changeCurrentTab(2); + }); }, label: 'Next', ), @@ -428,6 +455,10 @@ class _PickupLocationState extends State { return _selectedHospital == null ? title : _selectedHospital.name; } + String getSelectFromMapName() { + return _result != null ? _result.formattedAddress : 'Select From Map'; + } + getAppointment() { ProgressDialogUtil.showProgressDialog(context); widget.amRequestViewModel.getAppointmentHistory().then((value) { diff --git a/lib/pages/ErService/AmbulanceRequestIndexPages/SelectTransportationMethod.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/SelectTransportationMethod.dart index 59c3b85c..01683b55 100644 --- a/lib/pages/ErService/AmbulanceRequestIndexPages/SelectTransportationMethod.dart +++ b/lib/pages/ErService/AmbulanceRequestIndexPages/SelectTransportationMethod.dart @@ -284,8 +284,9 @@ class _SelectTransportationMethodState textColor: Colors.white, onTap: () { setState(() { - widget.patientER.direction = _direction == Direction.ToHospital ? 0 : 1; - widget.patientER.tripType = _way == Way.TwoWays ? 2 : 1; + widget.patientER.transportationMethodId =(widget.amRequestViewModel.amRequestModeList.indexOf(_erTransportationMethod) + 1); + widget.patientER.direction = _direction == Direction.ToHospital ? 1 : 0; + widget.patientER.tripType = _way == Way.TwoWays ? 0 : 1; widget.patientER.selectedAmbulate = (widget.amRequestViewModel.amRequestModeList.indexOf(_erTransportationMethod) + 1); widget.patientER.patientERTransportationMethod = _erTransportationMethod; widget.patientER.orderServiceID = _orderService.getIdOrderService(); @@ -294,7 +295,6 @@ class _SelectTransportationMethodState widget.patientER.cost = _erTransportationMethod.price; widget.patientER.vAT = _erTransportationMethod.vAT ?? 0; widget.patientER.totalPrice = _erTransportationMethod.totalPrice; - widget.changeCurrentTab(1); }); }, diff --git a/lib/pages/ErService/AmbulanceRequestIndexPages/Summary.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/Summary.dart index 4c189707..7696dd09 100644 --- a/lib/pages/ErService/AmbulanceRequestIndexPages/Summary.dart +++ b/lib/pages/ErService/AmbulanceRequestIndexPages/Summary.dart @@ -17,6 +17,7 @@ class Summary extends StatefulWidget { _SummaryState createState() => _SummaryState(); } +//TODO it should be dynamic class _SummaryState extends State { @override Widget build(BuildContext context) { @@ -30,7 +31,6 @@ class _SummaryState extends State { SizedBox(height: 5,), Container( width: double.infinity, - padding: EdgeInsets.all(10), decoration: BoxDecoration( color: Colors.white, @@ -92,9 +92,11 @@ class _SummaryState extends State { child:SecondaryButton( color: Colors.grey[800], textColor: Colors.white, - label: 'Next', + label: 'Send', + onTap: () async { + await widget.amRequestViewModel.insertERPressOrder(patientER: widget.patientER); - // onTap: ()=> widget.changeCurrentTab(2), + } ), ) ], diff --git a/lib/pages/ErService/OrderLogPage.dart b/lib/pages/ErService/OrderLogPage.dart index cbb508e5..6929cd0b 100644 --- a/lib/pages/ErService/OrderLogPage.dart +++ b/lib/pages/ErService/OrderLogPage.dart @@ -1,6 +1,8 @@ import 'package:diplomaticquarterapp/core/model/er/PatientAllPresOrders.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/OrderLogItem.dart'; import 'package:flutter/cupertino.dart'; @@ -53,6 +55,28 @@ class OrderLogPage extends StatelessWidget { value: amRequestViewModel .patientAllPresOrdersList[index].dropoffLocationName, ), + if(amRequestViewModel.patientAllPresOrdersList[index].status==1) + Container( + padding: EdgeInsets.all(10), + width: double.maxFinite, + margin: EdgeInsets.only(bottom: 4,left: 4,right: 4), + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + bottomRight: Radius.circular(12), + bottomLeft: Radius.circular(12), + ), + color: Colors.white + ), + child: SecondaryButton( + color: Colors.red[900], + textColor: Colors.white, + label: TranslationBase.of(context).cancel, + onTap: () { + amRequestViewModel.updatePressOrder(presOrderID:amRequestViewModel.pickUpRequestPresOrder.presOrderID ); + + }, + ), + ) ], ), ), diff --git a/lib/pages/MyAppointments/AppointmentDetails.dart b/lib/pages/MyAppointments/AppointmentDetails.dart index e3538277..db2b0643 100644 --- a/lib/pages/MyAppointments/AppointmentDetails.dart +++ b/lib/pages/MyAppointments/AppointmentDetails.dart @@ -172,7 +172,7 @@ class _AppointmentDetailsState extends State physics: NeverScrollableScrollPhysics(), children: [ AppointmentActions(appo: widget.appo, tabController: _tabController, enableFooterButton: enableFooterButton), - DocAvailableAppointments(doctor: getDoctorObject()) + DocAvailableAppointments(doctor: getDoctorObject(), isLiveCareAppointment: widget.appo.isLiveCareAppointment) ], controller: _tabController, ), diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index 7c20b53d..9ba57084 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -139,7 +139,7 @@ class _ToDoState extends State { flex: 3, child: Container( margin: EdgeInsets.only( - top: 20.0, left: 20.0, right: 20.0), + top: 10.0, left: 20.0, right: 20.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/pages/ToDoList/payment_method_select.dart b/lib/pages/ToDoList/payment_method_select.dart index a44d8b3d..a6936083 100644 --- a/lib/pages/ToDoList/payment_method_select.dart +++ b/lib/pages/ToDoList/payment_method_select.dart @@ -1,5 +1,4 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; @@ -69,7 +68,7 @@ class _PaymentMethodState extends State { child: Container( child: InkWell( onTap: () { - updateSelectedPaymentMethod("SADAD"); + updateSelectedPaymentMethod("VISA"); }, child: Card( elevation: 3.0, @@ -77,7 +76,7 @@ class _PaymentMethodState extends State { color: Colors.white, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(10), - side: selectedPaymentMethod == "SADAD" + side: selectedPaymentMethod == "VISA" ? BorderSide( color: Colors.green, width: 5.0) : BorderSide( @@ -88,12 +87,41 @@ class _PaymentMethodState extends State { padding: EdgeInsets.all(7.0), width: MediaQuery.of(context).size.width * 0.45, child: Image.asset( - "assets/images/new-design/sadad.png"), + "assets/images/new-design/visa.png"), ), ), ), ), ), +// Expanded( +// child: Container( +// child: InkWell( +// onTap: () { +// updateSelectedPaymentMethod("SADAD"); +// }, +// child: Card( +// elevation: 3.0, +// margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), +// color: Colors.white, +// shape: RoundedRectangleBorder( +// borderRadius: BorderRadius.circular(10), +// side: selectedPaymentMethod == "SADAD" +// ? BorderSide( +// color: Colors.green, width: 5.0) +// : BorderSide( +// color: Colors.transparent, width: 0.0), +// ), +// child: Container( +// height: 120.0, +// padding: EdgeInsets.all(7.0), +// width: MediaQuery.of(context).size.width * 0.45, +// child: Image.asset( +// "assets/images/new-design/sadad.png"), +// ), +// ), +// ), +// ), +// ), ], ), ), @@ -102,35 +130,6 @@ class _PaymentMethodState extends State { child: Flex( direction: Axis.horizontal, children: [ - Expanded( - child: Container( - child: InkWell( - onTap: () { - updateSelectedPaymentMethod("VISA"); - }, - child: Card( - elevation: 3.0, - margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), - color: Colors.white, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10), - side: selectedPaymentMethod == "VISA" - ? BorderSide( - color: Colors.green, width: 5.0) - : BorderSide( - color: Colors.transparent, width: 0.0), - ), - child: Container( - height: 120.0, - padding: EdgeInsets.all(7.0), - width: MediaQuery.of(context).size.width * 0.45, - child: Image.asset( - "assets/images/new-design/visa.png"), - ), - ), - ), - ), - ), Expanded( child: Container( child: InkWell( @@ -160,14 +159,6 @@ class _PaymentMethodState extends State { ), ), ), - ], - ), - ), - Container( - margin: EdgeInsets.only(top: 25.0), - child: Flex( - direction: Axis.horizontal, - children: [ Expanded( child: Container( child: InkWell( @@ -200,6 +191,13 @@ class _PaymentMethodState extends State { ], ), ), + Container( + margin: EdgeInsets.only(top: 25.0), + child: Flex( + direction: Axis.horizontal, + children: [], + ), + ), ], ), ), diff --git a/lib/pages/ToDoList/widgets/paymentDialog.dart b/lib/pages/ToDoList/widgets/paymentDialog.dart index d79a1ead..2fbcbcc1 100644 --- a/lib/pages/ToDoList/widgets/paymentDialog.dart +++ b/lib/pages/ToDoList/widgets/paymentDialog.dart @@ -24,7 +24,7 @@ class _PaymentDialogState extends State { shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12.0)), child: Container( - height: MediaQuery.of(context).size.height * 0.67, + height: 510.0, width: 450.0, child: Column( crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index 348fec58..8de6fe6b 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -1,6 +1,8 @@ import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.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'; import 'package:diplomaticquarterapp/pages/ContactUs/contact_us_page.dart'; import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-drivethru-location.dart'; @@ -8,6 +10,7 @@ import 'package:diplomaticquarterapp/pages/ErService/ErOptions.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart'; import 'package:diplomaticquarterapp/pages/paymentService/payment_service.dart'; +import 'package:diplomaticquarterapp/pages/pharmacies/screens/pharmacy_module_page.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/wishlist.dart'; import 'package:diplomaticquarterapp/pages/pharmacy/order/OrderDetails.dart'; import 'package:diplomaticquarterapp/pages/pharmacy/pharmacyAddresses/AddAddress.dart'; @@ -105,10 +108,10 @@ class _HomePageState extends State { 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), + child: SvgPicture.asset( + 'assets/images/new-design/covid-19-car.svg', + width: 45.0, + height: 45.0), ), Container( margin: EdgeInsets.only( @@ -182,11 +185,11 @@ class _HomePageState extends State { .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', - // ), + child: SvgPicture.asset( + projectViewModel.isArabic + ? 'assets/images/new-design/livecare_arabic_logo.svg' + : 'assets/images/new-design/liveCare_white_logo.svg', + ), ), ), ), @@ -447,6 +450,14 @@ class _HomePageState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ DashboardItem( + onTap: () { + Navigator.push( + context, + FadePage( + page: HomeHealthCareIndexPage(), + ), + ); + }, child: Center( child: Padding( padding: const EdgeInsets.all(15.0), @@ -478,7 +489,8 @@ class _HomePageState extends State { ), DashboardItem( onTap: () => Navigator.push( - context, FadePage(page: OrderPage())), + context, FadePage(page: PharmacyPage())), + child: Center( child: Padding( padding: const EdgeInsets.all(15.0), @@ -505,8 +517,19 @@ class _HomePageState extends State { ), height: MediaQuery.of(context).size.width * 0.4, imageName: 'al-habib_onlne_pharmacy_bg.png', +// onTap: (){ +// Navigator.push(context, FadePage(page: WishlistPage())); +// }, ), DashboardItem( + onTap: () { + Navigator.push( + context, + FadePage( + page: CMCIndexPage(), + ), + ); + }, child: Center( child: Padding( padding: const EdgeInsets.all(15.0), @@ -775,7 +798,8 @@ class DashboardItem extends StatelessWidget { this.width, this.height, this.color, - this.opacity = 0.4}) + this.opacity = 0.4, + this.hasColorFilter = true}) : super(key: key); final bool hasBorder; final String imageName; @@ -785,6 +809,7 @@ class DashboardItem extends StatelessWidget { final double height; final Color color; final double opacity; + final bool hasColorFilter; @override Widget build(BuildContext context) { @@ -811,8 +836,10 @@ class DashboardItem extends StatelessWidget { ? DecorationImage( image: ExactAssetImage('assets/images/$imageName'), fit: BoxFit.cover, - colorFilter: new ColorFilter.mode( - Colors.black.withOpacity(0.2), BlendMode.dstIn), + colorFilter: hasColorFilter + ? new ColorFilter.mode( + Colors.black.withOpacity(0.2), BlendMode.dstIn) + : null, ) : null, ), diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index ff21d73e..aa8e25d1 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -123,138 +123,138 @@ class _LandingPageState extends State with WidgetsBindingObserver { AppGlobal.context = context; }); _requestIOSPermissions(); - pageController = PageController(keepPage: true); - _firebaseMessaging.setAutoInitEnabled(true); - - if (Platform.isIOS) { - _firebaseMessaging.requestNotificationPermissions(); - } - - _firebaseMessaging.getToken().then((String token) { - sharedPref.setString(PUSH_TOKEN, token); - if (token != null) { - checkUserStatus(token); - } - requestPermissions(); - }).catchError((err) { - print(err); - }); - - //_firebase Background message handler - _firebaseMessaging.configure( - // onMessage: (Map message) async { - // showDialog("onMessage: $message"); - // print("onMessage: $message"); - // print(message); - // print(message['name']); - // print(message['appointmentdate']); - // - // if (Platform.isIOS) { - // if (message['is_call'] == "true") { - // var route = ModalRoute.of(context); - // - // if (route != null) { - // print(route.settings.name); - // } - // - // Map myMap = new Map.from(message); - // print(myMap); - // LandingPage.isOpenCallPage = true; - // LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); - // if (!isPageNavigated) { - // isPageNavigated = true; - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (context) => IncomingCall( - // incomingCallData: LandingPage.incomingCallData))) - // .then((value) { - // isPageNavigated = false; - // }); - // } - // } else { - // print("Is Call Not Found iOS"); - // } - // } else { - // print("Is Call Not Found iOS"); - // } - // - // if (Platform.isAndroid) { - // if (message['data'].containsKey("is_call")) { - // var route = ModalRoute.of(context); - // - // if (route != null) { - // print(route.settings.name); - // } - // - // Map myMap = - // new Map.from(message['data']); - // print(myMap); - // LandingPage.isOpenCallPage = true; - // LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); - // if (!isPageNavigated) { - // isPageNavigated = true; - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (context) => IncomingCall( - // incomingCallData: LandingPage.incomingCallData))) - // .then((value) { - // isPageNavigated = false; - // }); - // } - // } else { - // print("Is Call Not Found Android"); - // } - // } else { - // print("Is Call Not Found Android"); - // } - // }, - // onBackgroundMessage: Platform.isIOS ? null : myBackgroundMessageHandler, - // onLaunch: (Map message) async { - // print("onLaunch: $message"); - // showDialog("onLaunch: $message"); - // }, - // onResume: (Map message) async { - // print("onResume: $message"); - // print(message); - // print(message['name']); - // print(message['appointmentdate']); - // - // showDialog("onResume: $message"); - // - // if (Platform.isIOS) { - // if (message['is_call'] == "true") { - // var route = ModalRoute.of(context); - // - // if (route != null) { - // print(route.settings.name); - // } - // - // Map myMap = - // new Map.from(message); - // print(myMap); - // LandingPage.isOpenCallPage = true; - // LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); - // if (!isPageNavigated) { - // isPageNavigated = true; - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (context) => IncomingCall( - // incomingCallData: LandingPage.incomingCallData))) - // .then((value) { - // isPageNavigated = false; - // }); - // } - // } else { - // print("Is Call Not Found iOS"); - // } - // } else { - // print("Is Call Not Found iOS"); - // } - // }, - ); + pageController = PageController(keepPage: true); + // _firebaseMessaging.setAutoInitEnabled(true); + // + // if (Platform.isIOS) { + // _firebaseMessaging.requestNotificationPermissions(); + // } + // + // _firebaseMessaging.getToken().then((String token) { + // sharedPref.setString(PUSH_TOKEN, token); + // if (token != null) { + // checkUserStatus(token); + // } + // requestPermissions(); + // }).catchError((err) { + // print(err); + // }); + // + // //_firebase Background message handler + // _firebaseMessaging.configure( + // // onMessage: (Map message) async { + // // showDialog("onMessage: $message"); + // // print("onMessage: $message"); + // // print(message); + // // print(message['name']); + // // print(message['appointmentdate']); + // // + // // if (Platform.isIOS) { + // // if (message['is_call'] == "true") { + // // var route = ModalRoute.of(context); + // // + // // if (route != null) { + // // print(route.settings.name); + // // } + // // + // // Map myMap = new Map.from(message); + // // print(myMap); + // // LandingPage.isOpenCallPage = true; + // // LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); + // // if (!isPageNavigated) { + // // isPageNavigated = true; + // // Navigator.push( + // // context, + // // MaterialPageRoute( + // // builder: (context) => IncomingCall( + // // incomingCallData: LandingPage.incomingCallData))) + // // .then((value) { + // // isPageNavigated = false; + // // }); + // // } + // // } else { + // // print("Is Call Not Found iOS"); + // // } + // // } else { + // // print("Is Call Not Found iOS"); + // // } + // // + // // if (Platform.isAndroid) { + // // if (message['data'].containsKey("is_call")) { + // // var route = ModalRoute.of(context); + // // + // // if (route != null) { + // // print(route.settings.name); + // // } + // // + // // Map myMap = + // // new Map.from(message['data']); + // // print(myMap); + // // LandingPage.isOpenCallPage = true; + // // LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); + // // if (!isPageNavigated) { + // // isPageNavigated = true; + // // Navigator.push( + // // context, + // // MaterialPageRoute( + // // builder: (context) => IncomingCall( + // // incomingCallData: LandingPage.incomingCallData))) + // // .then((value) { + // // isPageNavigated = false; + // // }); + // // } + // // } else { + // // print("Is Call Not Found Android"); + // // } + // // } else { + // // print("Is Call Not Found Android"); + // // } + // // }, + // // onBackgroundMessage: Platform.isIOS ? null : myBackgroundMessageHandler, + // // onLaunch: (Map message) async { + // // print("onLaunch: $message"); + // // showDialog("onLaunch: $message"); + // // }, + // // onResume: (Map message) async { + // // print("onResume: $message"); + // // print(message); + // // print(message['name']); + // // print(message['appointmentdate']); + // // + // // showDialog("onResume: $message"); + // // + // // if (Platform.isIOS) { + // // if (message['is_call'] == "true") { + // // var route = ModalRoute.of(context); + // // + // // if (route != null) { + // // print(route.settings.name); + // // } + // // + // // Map myMap = + // // new Map.from(message); + // // print(myMap); + // // LandingPage.isOpenCallPage = true; + // // LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); + // // if (!isPageNavigated) { + // // isPageNavigated = true; + // // Navigator.push( + // // context, + // // MaterialPageRoute( + // // builder: (context) => IncomingCall( + // // incomingCallData: LandingPage.incomingCallData))) + // // .then((value) { + // // isPageNavigated = false; + // // }); + // // } + // // } else { + // // print("Is Call Not Found iOS"); + // // } + // // } else { + // // print("Is Call Not Found iOS"); + // // } + // // }, + // ); } showDialogs(String message) { diff --git a/lib/pages/livecare/widgets/clinic_card.dart b/lib/pages/livecare/widgets/clinic_card.dart index 99c4b271..56613034 100644 --- a/lib/pages/livecare/widgets/clinic_card.dart +++ b/lib/pages/livecare/widgets/clinic_card.dart @@ -36,13 +36,13 @@ class _State extends State { return Row( children: [ Card( - margin: EdgeInsets.fromLTRB(13.0, 10.0, 8.0, 8.0), + margin: EdgeInsets.fromLTRB(15.0, 10.0, 8.0, 8.0), color: widget.isSelected ? Colors.blue : Colors.white, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(10), ), child: Container( - width: MediaQuery.of(context).size.width * 0.8, + width: MediaQuery.of(context).size.width * 0.75, padding: EdgeInsets.all(12.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/pages/livecare/widgets/clinic_list.dart b/lib/pages/livecare/widgets/clinic_list.dart index c1f5eb75..083af9f7 100644 --- a/lib/pages/livecare/widgets/clinic_list.dart +++ b/lib/pages/livecare/widgets/clinic_list.dart @@ -17,8 +17,11 @@ 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/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'; @@ -81,7 +84,13 @@ class _clinic_listState extends State { service .getERAppointmentFees(selectedClinicID, context) .then((res) { - erAppointmentFeesResponse = ERAppointmentFeesResponse.fromJson(res); + if (res['HasAppointment'] == true) { + isError = true; + showLiveCareCancelDialog(res['ErrorEndUserMessage'], res); + } else { + erAppointmentFeesResponse = ERAppointmentFeesResponse.fromJson(res); + isError = false; + } }) .catchError((err) { print(err); @@ -97,10 +106,57 @@ class _clinic_listState extends State { }); } + showLiveCareCancelDialog(String msg, res) { + ConfirmDialog dialog = new ConfirmDialog( + context: context, + confirmMessage: msg, + okText: TranslationBase.of(context).confirm, + cancelText: TranslationBase.of(context).cancel_nocaps, + okFunction: () => + {cancelAppointment(res)}, + cancelFunction: () => {}); + dialog.showAlertDialog(context); + } + + cancelAppointment(res) { + AppoitmentAllHistoryResultList appo = AppoitmentAllHistoryResultList(); + appo.clinicID = res['ClinicID']; + appo.doctorID = res['DoctorID']; + appo.endTime = res['EndTime']; + appo.projectID = res['ProjectID']; + appo.startTime = res['StrAppointmentDate']; + appo.appointmentNo = res['AppointmentID']; + appo.isLiveCareAppointment = true; + appo.originalClinicID = 0; + appo.originalProjectID = res['ProjectID']; + appo.appointmentDate = res['AppointmentDate']; + + ConfirmDialog.closeAlertDialog(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(); + }); + } + getERAppointmentTime(GetERAppointmentFeesList getERAppointmentFeesList) { LiveCareService service = new LiveCareService(); service.getERAppointmentTime(selectedClinicID, context).then((res) { - print(res['WatingtimeInteger']); + print(res); showLiveCarePaymentDialog( getERAppointmentFeesList, res['WatingtimeInteger']); }).catchError((err) { diff --git a/lib/pages/medical/balance/confirm_payment_page.dart b/lib/pages/medical/balance/confirm_payment_page.dart index cc5df0a6..8847aaa1 100644 --- a/lib/pages/medical/balance/confirm_payment_page.dart +++ b/lib/pages/medical/balance/confirm_payment_page.dart @@ -247,8 +247,8 @@ class ConfirmPaymentPage extends StatelessWidget { DoctorsListService service = new DoctorsListService(); service .checkPaymentStatus( - Utils.getAppointmentTransID( - appo.projectID, appo.clinicID, appo.appointmentNo), + Utils.getAdvancePaymentTransID( + appo.projectID, authenticatedUser.patientID), AppGlobal.context) .then((res) { print("Printing Payment Status Reponse!!!!"); @@ -302,5 +302,4 @@ class ConfirmPaymentPage extends StatelessWidget { Future navigateToHome(context) async { Navigator.of(context).pushNamed(HOME); } - } diff --git a/lib/pages/medical/medical_profile_page.dart b/lib/pages/medical/medical_profile_page.dart index e7d75e7f..61f22aca 100644 --- a/lib/pages/medical/medical_profile_page.dart +++ b/lib/pages/medical/medical_profile_page.dart @@ -7,6 +7,7 @@ import 'package:diplomaticquarterapp/pages/MyAppointments/MyAppointments.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.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'; import 'package:diplomaticquarterapp/pages/vaccine/my_vaccines_screen.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_home_page.dart'; import 'package:diplomaticquarterapp/pages/medical/radiology/radiology_home_page.dart'; @@ -407,10 +408,10 @@ class _MedicalProfilePageState extends State { flex: 1, child: InkWell( //TODO -// onTap: () { -// Navigator.push( -// context, FadePage(page: DoctorHomePage())); -// }, + onTap: () { + Navigator.push( + context, FadePage(page: SmartWatchInstructions())); + }, child: MedicalProfileItem( title: TranslationBase.of(context) .smartWatches, diff --git a/lib/pages/medical/smart_watch_health_data/health_data_list.dart b/lib/pages/medical/smart_watch_health_data/health_data_list.dart new file mode 100644 index 00000000..2f9a3e60 --- /dev/null +++ b/lib/pages/medical/smart_watch_health_data/health_data_list.dart @@ -0,0 +1,145 @@ +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; + +class HealthDataList extends StatefulWidget { + @override + _HealthDataListState createState() => _HealthDataListState(); +} + +class _HealthDataListState extends State { + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: "Smartwatches", + isShowAppBar: true, + body: Container( + height: MediaQuery.of(context).size.height, + margin: EdgeInsets.all(20.0), + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Container( + child: Image.asset( + "assets/images/SmartWatches/heartrate_icon.png", + width: 60.0, + height: 60.0), + ), + Container( + margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0), + child: Text("Heart Rate", + style: TextStyle( + fontSize: 20.0, fontWeight: FontWeight.bold)), + ), + ], + ), + Divider( + color: Colors.grey[500], + ), + Row( + children: [ + Container( + child: Image.asset( + "assets/images/SmartWatches/sleep_data.png", + width: 60.0, + height: 60.0), + ), + Container( + margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0), + child: Text("Sleep Data", + style: TextStyle( + fontSize: 20.0, fontWeight: FontWeight.bold)), + ), + ], + ), + Divider( + color: Colors.grey[500], + ), + Row( + children: [ + Container( + child: Image.asset( + "assets/images/SmartWatches/heartrate_icon.png", + width: 60.0, + height: 60.0), + ), + Container( + margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0), + child: Text("Steps", + style: TextStyle( + fontSize: 20.0, fontWeight: FontWeight.bold)), + ), + ], + ), + Divider( + color: Colors.grey[500], + ), + Row( + children: [ + Container( + child: Image.asset( + "assets/images/SmartWatches/heartrate_icon.png", + width: 60.0, + height: 60.0), + ), + Container( + margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0), + child: Text("Distance", + style: TextStyle( + fontSize: 20.0, fontWeight: FontWeight.bold)), + ), + ], + ), + Divider( + color: Colors.grey[500], + ), + Row( + children: [ + Container( + child: Image.asset( + "assets/images/SmartWatches/heartrate_icon.png", + width: 60.0, + height: 60.0), + ), + Container( + margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0), + child: Text("Energy", + style: TextStyle( + fontSize: 20.0, fontWeight: FontWeight.bold)), + ), + ], + ), + Divider( + color: Colors.grey[500], + ), + ], + ), + ), + ), + bottomSheet: Container( + width: double.infinity, + height: MediaQuery.of(context).size.height * 0.1, + color: Colors.grey[100], + child: Column( + children: [ + Divider( + color: Colors.transparent, + ), + Container( + width: MediaQuery.of(context).size.width * 0.8, + child: Button( + onTap: () { +// launch(model.radImageURL); + }, + label: 'Sync Health Data', + backgroundColor: Colors.grey[800], + ), + ), + ], + ), + )); + } +} diff --git a/lib/pages/medical/smart_watch_health_data/smart_watch_instructions.dart b/lib/pages/medical/smart_watch_health_data/smart_watch_instructions.dart new file mode 100644 index 00000000..eb0c1675 --- /dev/null +++ b/lib/pages/medical/smart_watch_health_data/smart_watch_instructions.dart @@ -0,0 +1,819 @@ +import 'dart:io'; + +import 'package:carousel_slider/carousel_slider.dart'; +import 'package:diplomaticquarterapp/pages/medical/smart_watch_health_data/health_data_list.dart'; +import 'package:diplomaticquarterapp/services/smartwatch_integration/SmartWatchIntegrationService.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; +import 'package:url_launcher/url_launcher.dart'; + +class SmartWatchInstructions extends StatefulWidget { + @override + _SmartWatchInstructionsState createState() => _SmartWatchInstructionsState(); +} + +class _SmartWatchInstructionsState extends State { + CarouselController buttonCarouselController = CarouselController(); + + bool hasAlreadySynced = false; + + @override + void initState() { + WidgetsBinding.instance.addPostFrameCallback((timeStamp) { + getLastPatientRecord(context); + }); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: "Sync Health Data", + isShowAppBar: true, + body: Container( + child: Platform.isIOS + ? _getAppleWatchInstructions() + : _getGoogleWatchInstructions(), + )); + } + + _getAppleWatchInstructions() { + return SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only(top: 10.0), + child: CarouselSlider( + carouselController: buttonCarouselController, + options: CarouselOptions( + enableInfiniteScroll: false, + viewportFraction: 0.95, + height: MediaQuery.of(context).size.height * 0.9), + items: [1, 2].map((i) { + return Builder( + builder: (BuildContext context) { + return Container( + width: MediaQuery.of(context).size.width, + margin: EdgeInsets.symmetric(horizontal: 5.0), + child: Card( + margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), + color: Colors.white.withOpacity(1.0), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + ), + child: i == 1 + ? Column( + children: [ + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text("Supported Smartwatches", + style: TextStyle( + fontSize: 22.0, + fontWeight: FontWeight.bold, + fontFamily: "WorkSans")), + ), + Container( + child: Row( + children: [ + Expanded( + child: Container( + margin: + EdgeInsets.only(top: 10.0), + child: Row( + children: [ + Image.asset( + "assets/images/SmartWatches/apple-watch-1.jpeg", + width: 70.0, + height: 70.0), + Container( + child: Text( + "Apple Watch Series 1", + style: TextStyle( + fontSize: 12.0)), + ) + ], + ), + ), + ), + Expanded( + child: Container( + margin: + EdgeInsets.only(top: 10.0), + child: Row( + children: [ + Image.asset( + "assets/images/SmartWatches/apple-watch-2.jpg", + width: 70.0, + height: 70.0), + Container( + child: Text( + "Apple Watch Series 2", + style: TextStyle( + fontSize: 12.0)), + ) + ], + ), + ), + ), + ], + ), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Row( + children: [ + Expanded( + child: Container( + margin: + EdgeInsets.only(top: 15.0), + child: Row( + children: [ + Image.asset( + "assets/images/SmartWatches/apple-watch-3.jpg", + width: 70.0, + height: 70.0), + Container( + child: Text( + "Apple Watch Series 3", + style: TextStyle( + fontSize: 12.0)), + ) + ], + ), + ), + ), + Expanded( + child: Container( + margin: + EdgeInsets.only(top: 15.0), + child: Row( + children: [ + Image.asset( + "assets/images/SmartWatches/apple-watch-4.jpg", + width: 70.0, + height: 70.0), + Container( + child: Text( + "Apple Watch Series 4", + style: TextStyle( + fontSize: 12.0)), + ) + ], + ), + ), + ), + ], + ), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Row( + children: [ + Expanded( + child: Container( + margin: + EdgeInsets.only(top: 15.0), + child: Row( + children: [ + Image.asset( + "assets/images/SmartWatches/apple-watch-5.jpg", + width: 70.0, + height: 70.0), + Container( + child: Text( + "Apple Watch Series 5", + style: TextStyle( + fontSize: 12.0)), + ) + ], + ), + ), + ), + Expanded( + child: Container( + margin: + EdgeInsets.only(top: 15.0), + child: Row( + children: [ + Image.asset( + "assets/images/SmartWatches/Apple-Watch-6.png", + width: 70.0, + height: 70.0), + Container( + child: Text( + "Apple Watch Series 6", + style: TextStyle( + fontSize: 12.0)), + ) + ], + ), + ), + ), + ], + ), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Row( + children: [ + Expanded( + child: Container( + margin: + EdgeInsets.only(top: 15.0), + child: Row( + children: [ + Image.asset( + "assets/images/SmartWatches/miBand3.jpg", + width: 70.0, + height: 70.0), + Container( + child: Text("Mi Band 3", + style: TextStyle( + fontSize: 12.0)), + ) + ], + ), + ), + ), + Expanded( + child: Container( + margin: + EdgeInsets.only(top: 15.0), + child: Row( + children: [ + Image.asset( + "assets/images/SmartWatches/miBand4.jpg", + width: 70.0, + height: 70.0), + Container( + child: Text("Mi Band 4", + style: TextStyle( + fontSize: 12.0)), + ) + ], + ), + ), + ), + ], + ), + ), + Container( + margin: EdgeInsets.fromLTRB( + 10.0, 30.0, 10.0, 10.0), + child: Text( + "It Seems like you haven't synced your health data with the Dr. Alhabib App before. To proceed further, you need to sync your health data with the Dr. Alhabib App", + textAlign: TextAlign.center, + style: TextStyle(fontSize: 17.0)), + ), + Container( + margin: EdgeInsets.all(10.0), + child: Text( + "Before syncing data, please make sure that you have followed the instructions properly", + textAlign: TextAlign.center, + style: TextStyle(fontSize: 17.0)), + ), + Container( + margin: EdgeInsets.all(15.0), + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular(10.0), + ), + minWidth: + MediaQuery.of(context).size.width, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF60686b), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { + buttonCarouselController.nextPage(); + }, + child: Text("CONTINUE", + style: TextStyle(fontSize: 18.0)), + ), + ), + ), + ], + ) + : Column( + children: [ + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text("Watch Instructions:", + style: TextStyle( + fontSize: 22.0, + fontWeight: FontWeight.bold, + fontFamily: "WorkSans")), + ), + Container( + margin: EdgeInsets.all(10.0), + child: Text( + "It Seems like you haven't synced your health data with the Dr. Alhabib App before. To proceed further, you need to sync your health data with the Dr. Alhabib App", + textAlign: TextAlign.center, + style: TextStyle(fontSize: 17.0)), + ), + Container( + margin: EdgeInsets.fromLTRB( + 10.0, 20.0, 10.0, 10.0), + child: Text( + "Before syncing data, please make sure that following instructions are met: ", + textAlign: TextAlign.center, + style: TextStyle(fontSize: 17.0)), + ), + Container( + margin: EdgeInsets.fromLTRB( + 10.0, 20.0, 10.0, 10.0), + child: Text( + "1. Make sure that you have installed 'Health' App & 'Watch' App from Apple Store.", + textAlign: TextAlign.center, + style: TextStyle(fontSize: 17.0)), + ), + Container( + margin: EdgeInsets.all(10.0), + child: Text( + "2. Make sure that your Apple Watch is connected with the Watch & Health Apps.", + textAlign: TextAlign.center, + style: TextStyle(fontSize: 17.0)), + ), + Container( + margin: EdgeInsets.all(10.0), + child: Text( + "3. Make sure that data like heart rate, steps, distance etc. are being shown on your health app.", + textAlign: TextAlign.center, + style: TextStyle(fontSize: 17.0)), + ), + Container( + margin: EdgeInsets.fromLTRB( + 15.0, 110.0, 15.0, 15.0), + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular(10.0), + ), + minWidth: + MediaQuery.of(context).size.width, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF60686b), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { + buttonCarouselController.nextPage(); + }, + child: Text("SYNC HEALTH DATA", + style: TextStyle(fontSize: 18.0)), + ), + ), + ), + hasAlreadySynced ? Container( + margin: EdgeInsets.fromLTRB( + 15.0, 0.0, 15.0, 15.0), + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular(10.0), + ), + minWidth: + MediaQuery.of(context).size.width, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF60686b), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { + _openHealthDataList(); + }, + child: Text("ALREADY SYNCED", + style: TextStyle(fontSize: 18.0)), + ), + ), + ): Container(), + ], + ), + )); + }, + ); + }).toList(), + ), + ) + ], + ), + ); + } + + _getGoogleWatchInstructions() { + return SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only(top: 10.0), + child: CarouselSlider( + carouselController: buttonCarouselController, + options: CarouselOptions( + enableInfiniteScroll: false, + viewportFraction: 0.95, + height: MediaQuery.of(context).size.height * 0.9), + items: [1, 2].map((i) { + return Builder( + builder: (BuildContext context) { + return Container( + width: MediaQuery.of(context).size.width, + margin: EdgeInsets.symmetric(horizontal: 5.0), + child: Card( + margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), + color: Colors.white.withOpacity(1.0), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + ), + child: i == 1 + ? Column( + children: [ + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text("Supported Smartwatches", + style: TextStyle( + fontSize: 22.0, + fontWeight: FontWeight.bold, + fontFamily: "WorkSans")), + ), + Container( + child: Row( + children: [ + Expanded( + child: Container( + margin: + EdgeInsets.only(top: 10.0), + child: Row( + children: [ + Image.asset( + "assets/images/SmartWatches/huawei-watch-2.png", + width: 70.0, + height: 70.0), + Container( + child: Text( + "Huawei Watch 2", + style: TextStyle( + fontSize: 12.0)), + ) + ], + ), + ), + ), + Expanded( + child: Container( + margin: + EdgeInsets.only(top: 10.0), + child: Row( + children: [ + Image.asset( + "assets/images/SmartWatches/ticwatche2.png", + width: 70.0, + height: 70.0), + Container( + child: Text( + "Mobovi TicWatch E2", + style: TextStyle( + fontSize: 12.0)), + ) + ], + ), + ), + ), + ], + ), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Row( + children: [ + Expanded( + child: Container( + margin: + EdgeInsets.only(top: 15.0), + child: Row( + children: [ + Image.asset( + "assets/images/SmartWatches/huawei-watch-2-classic.png", + width: 70.0, + height: 70.0), + Container( + child: Text("Huawei Watch", + style: TextStyle( + fontSize: 12.0)), + ) + ], + ), + ), + ), + Expanded( + child: Container( + margin: + EdgeInsets.only(top: 15.0), + child: Row( + children: [ + Image.asset( + "assets/images/SmartWatches/ticwatche2.png", + width: 70.0, + height: 70.0), + Container( + child: Text("Fossil Sport", + style: TextStyle( + fontSize: 12.0)), + ) + ], + ), + ), + ), + ], + ), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Row( + children: [ + Expanded( + child: Container( + margin: + EdgeInsets.only(top: 15.0), + child: Row( + children: [ + Image.asset( + "assets/images/SmartWatches/misfit-vapor-2.jpg", + width: 70.0, + height: 70.0), + Container( + child: Text( + "MisFit Vapor 2", + style: TextStyle( + fontSize: 12.0)), + ) + ], + ), + ), + ), + Expanded( + child: Container( + margin: + EdgeInsets.only(top: 15.0), + child: Row( + children: [ + Image.asset( + "assets/images/SmartWatches/lg-watch-sport.jpg", + width: 70.0, + height: 70.0), + Container( + child: Text( + "LG Watch Sport", + style: TextStyle( + fontSize: 12.0)), + ) + ], + ), + ), + ), + ], + ), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Row( + children: [ + Expanded( + child: Container( + margin: + EdgeInsets.only(top: 15.0), + child: Row( + children: [ + Image.asset( + "assets/images/SmartWatches/miBand3.jpg", + width: 70.0, + height: 70.0), + Container( + child: Text("Mi Band 3", + style: TextStyle( + fontSize: 12.0)), + ) + ], + ), + ), + ), + Expanded( + child: Container( + margin: + EdgeInsets.only(top: 15.0), + child: Row( + children: [ + Image.asset( + "assets/images/SmartWatches/miBand4.jpg", + width: 70.0, + height: 70.0), + Container( + child: Text("Mi Band 4", + style: TextStyle( + fontSize: 12.0)), + ) + ], + ), + ), + ), + ], + ), + ), + InkWell( + onTap: () { + launch( + "https://wearos.google.com/#find-your-watch"); + }, + child: Container( + margin: EdgeInsets.only(top: 20.0), + child: Text( + "More Supported Smartwatches...", + style: TextStyle( + fontSize: 17.0, + color: Colors.blue, + decoration: + TextDecoration.underline)), + ), + ), + Container( + margin: EdgeInsets.all(10.0), + child: Text( + "It Seems like you haven't synced your health data with the Dr. Alhabib App before. To proceed further, you need to sync your health data with the Dr. Alhabib App", + textAlign: TextAlign.center, + style: TextStyle(fontSize: 17.0)), + ), + Container( + margin: EdgeInsets.all(10.0), + child: Text( + "Before syncing data, please make sure that you have followed the instructions properly", + textAlign: TextAlign.center, + style: TextStyle(fontSize: 17.0)), + ), + Container( + margin: EdgeInsets.all(15.0), + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular(10.0), + ), + minWidth: + MediaQuery.of(context).size.width, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF60686b), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { + buttonCarouselController.nextPage(); + }, + child: Text("CONTINUE", + style: TextStyle(fontSize: 18.0)), + ), + ), + ), + ], + ) + : Column( + children: [ + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text("Watch Instructions:", + style: TextStyle( + fontSize: 22.0, + fontWeight: FontWeight.bold, + fontFamily: "WorkSans")), + ), + Container( + margin: EdgeInsets.all(10.0), + child: Text( + "It Seems like you haven't synced your health data with the Dr. Alhabib App before. To proceed further, you need to sync your health data with the Dr. Alhabib App", + textAlign: TextAlign.center, + style: TextStyle(fontSize: 17.0)), + ), + Container( + margin: EdgeInsets.all(10.0), + child: Text( + "Before syncing data, please make sure that following instructions are met: ", + textAlign: TextAlign.center, + style: TextStyle(fontSize: 17.0)), + ), + Container( + margin: EdgeInsets.all(10.0), + child: Text( + "1. Make sure that you have installed 'WearOS' & 'Google Fit' apps from Google PlayStore.", + textAlign: TextAlign.center, + style: TextStyle(fontSize: 17.0)), + ), + Container( + margin: EdgeInsets.all(10.0), + child: Text( + "2. Make sure that you have installed your watch related apps from Google PlayStore.", + textAlign: TextAlign.center, + style: TextStyle(fontSize: 17.0)), + ), + Container( + margin: EdgeInsets.all(10.0), + child: Text( + "3. Make sure that your Smart Watch is connected with the WearOS app & your watch apps.", + textAlign: TextAlign.center, + style: TextStyle(fontSize: 17.0)), + ), + Container( + margin: EdgeInsets.all(10.0), + child: Text( + "4. Make sure that your smart watch apps are linked/associated with Google Fit App.", + textAlign: TextAlign.center, + style: TextStyle(fontSize: 17.0)), + ), + Container( + margin: EdgeInsets.fromLTRB( + 15.0, 95.0, 15.0, 15.0), + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular(10.0), + ), + minWidth: + MediaQuery.of(context).size.width, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF60686b), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { + buttonCarouselController.nextPage(); + }, + child: Text("SYNC HEALTH DATA", + style: TextStyle(fontSize: 18.0)), + ), + ), + ), + hasAlreadySynced ? Container( + margin: EdgeInsets.fromLTRB( + 15.0, 0.0, 15.0, 15.0), + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular(10.0), + ), + minWidth: + MediaQuery.of(context).size.width, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF60686b), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { + _openHealthDataList(); + }, + child: Text("ALREADY SYNCED", + style: TextStyle(fontSize: 18.0)), + ), + ), + ) : Container(), + ], + ), + )); + }, + ); + }).toList(), + ), + ) + ], + ), + ); + } + + getLastPatientRecord(BuildContext context) { + SmartWatchIntegrationService service = new SmartWatchIntegrationService(); + service.getLastPatientRecord(context).then((res) { + if (res['MessageStatus'] == 1) { + print(res['Med_GetPatientLastRecordList']); + setState(() { + if (res['Med_GetPatientLastRecordList'] != null) + hasAlreadySynced = true; + else + hasAlreadySynced = false; + }); + } else {} + }).catchError((err) { + print(err); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + } + + _openHealthDataList() { + Navigator.push( + context, MaterialPageRoute(builder: (context) => HealthDataList())); + } +} diff --git a/lib/pages/pharmacies/screens/order-preview-page.dart b/lib/pages/pharmacies/screens/order-preview-page.dart new file mode 100644 index 00000000..d9646fcf --- /dev/null +++ b/lib/pages/pharmacies/screens/order-preview-page.dart @@ -0,0 +1,48 @@ +import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/GestureIconButton.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; + +class OrderPreviewPage extends StatelessWidget { + @override + Widget build(BuildContext context) { + return BaseView( + builder: (_, model, wi) => AppScaffold( + title: "Shopping Cart", + isShowAppBar: true, + isShowDecPage: false, + baseViewModel: model, + backgroundColor: Colors.white, + body: Container( + width: double.infinity, + child: SingleChildScrollView( + child: Container( + margin: EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + GestureIconButton( + TranslationBase.of(context).deleteAllItems, + Icon(Icons.delete_outline_sharp, color: Colors.grey.shade800,), + onTap: () => {}, + ), + const Divider( + color: Colors.grey, + height: 20, + thickness: 1, + indent: 0, + endIndent: 0, + ), + + ], + ), + ), + ), + ), + ), + ); + } +} + diff --git a/lib/pages/pharmacies/screens/pharmacy_module_page.dart b/lib/pages/pharmacies/screens/pharmacy_module_page.dart new file mode 100644 index 00000000..2ae2be65 --- /dev/null +++ b/lib/pages/pharmacies/screens/pharmacy_module_page.dart @@ -0,0 +1,245 @@ +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/pharmacies/widgets/BannerPager.dart'; +import 'package:diplomaticquarterapp/pages/pharmacies/widgets/ProductTileItem.dart'; +import 'package:diplomaticquarterapp/pages/pharmacies/widgets/manufacturerItem.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'; + +class PharmacyPage extends StatelessWidget { + + @override + Widget build(BuildContext context) { + return BaseView( + // onModelReady: (model) => model.getPharmacyHomeData(), + onModelReady: (model) => model.getPharmacyHomeData(), + builder: (_, model, wi) => AppScaffold( + title: "", + isShowAppBar: true, + isShowDecPage: false, + baseViewModel: model, + backgroundColor: Colors.white, + body: Container( + width: double.infinity, + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + BannerPager(model), + GridViewButtons(), + /*BannerPager(model.getBannerImagesUrl()),*/ + Container( + margin: EdgeInsets.fromLTRB(10, 0, 10, 0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts( + TranslationBase.of(context).shopByBrands, + bold: true, + ), + BorderedButton( + TranslationBase.of(context).viewAll, + hasBorder: true, + vPadding: 6, + borderColor: Colors.green, + color: Colors.green, + handler: () {}, + ), + ], + ), + ), + Container( + height: 60, + child: ListView.builder( + itemBuilder: (ctx, i) => + ManufacturerItem(model.manufacturerList[i]), + scrollDirection: Axis.horizontal, + itemCount: model.manufacturerList.length, + ), + ), + Container( + margin: EdgeInsets.fromLTRB(10, 10, 10, 10), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts( + TranslationBase.of(context).recentlyViewed, + bold: true, + ), + BorderedButton( + TranslationBase.of(context).viewAll, + hasBorder: true, + vPadding: 6, + borderColor: Colors.green, + color: Colors.green, + handler: () {}, + ), + ], + ), + ), + Container( + height: model.lastVisitedProducts.length > 0 ? MediaQuery.of(context).size.height / 4 : 0, + child: ListView.builder( + itemBuilder: (ctx, i) => + ProductTileItem(model.lastVisitedProducts[i]), + scrollDirection: Axis.horizontal, + itemCount: model.lastVisitedProducts.length, + ), + ), + Container( + margin: EdgeInsets.fromLTRB(10, 10, 10, 10), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts( + TranslationBase.of(context).bestSellers, + bold: true, + ), + BorderedButton( + TranslationBase.of(context).viewAll, + hasBorder: true, + borderColor: Colors.green, + color: Colors.green, + vPadding: 6, + handler: () {}, + ), + ], + ), + ), + Container( + height: MediaQuery.of(context).size.height / 4, + child: ListView.builder( + itemBuilder: (ctx, i) => + ProductTileItem(model.bestSellerProduct[i]), + scrollDirection: Axis.horizontal, + itemCount: model.bestSellerProduct.length, + ), + ), + ], + ), + ), + ), + ), + ); + } +} + +class GridViewButtons extends StatelessWidget { + @override + Widget build(BuildContext context) { + final gridHeight = (MediaQuery.of(context).size.width * 0.3) * 1.8; + return Container( + child: SizedBox( + height: gridHeight, + child: GridView.count( + childAspectRatio: 2.2, + crossAxisSpacing: 10, + mainAxisSpacing: 10, + controller: new ScrollController(keepScrollOffset: false), + shrinkWrap: true, + padding: const EdgeInsets.all(4.0), + crossAxisCount: 2, + children: [ + DashboardItem( + imageName: 'pharmacy_module/bg_1.png', + hasColorFilter: false, + opacity: 0.8, + child: GridViewCard( + TranslationBase.of(context).offersAndPromotions, + 'assets/images/pharmacy_module/offer_icon.png', + () { + Navigator.push(context, FadePage(page: OrderPreviewPage())); + }), + ), + DashboardItem( + imageName: 'pharmacy_module/bg_2.png', + opacity: 0, + hasColorFilter: false, + child: GridViewCard(TranslationBase.of(context).medicationRefill, + 'assets/images/pharmacy_module/medication_icon.png', () {}), + ), + DashboardItem( + imageName: 'pharmacy_module/bg_3.png', + opacity: 0, + hasColorFilter: false, + child: GridViewCard(TranslationBase.of(context).myPrescriptions, + 'assets/images/pharmacy_module/prescription_icon.png', () {}), + ), + DashboardItem( + imageName: 'pharmacy_module/bg_4.png', + opacity: 0, + hasColorFilter: false, + child: GridViewCard( + TranslationBase.of(context).searchAndScanMedication, + 'assets/images/pharmacy_module/search_scan_icon.png', + () {}), + ), + ], + ), + ), + ); + } +} + +class GridViewCard extends StatelessWidget { + final String text; + final String cardImage; + final Function handler; + + GridViewCard(this.text, this.cardImage, this.handler); + + @override + Widget build(BuildContext context) { + return Padding( + padding: const EdgeInsets.all(4.0), + child: Container( + child: Row( + children: [ + Expanded( + flex: 2, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + flex: 2, + child: Padding( + padding: const EdgeInsets.all(6), + child: Texts( + text, + color: Colors.white, + fontSize: SizeConfig.textMultiplier * 1.5, + ), + ), + ), + Expanded( + child: BorderedButton( + TranslationBase.of(context).viewAll, + handler: handler, + ), + ), + ], + ), + ), + Expanded( + child: Align( + alignment: Alignment.centerRight, + child: Image.asset( + cardImage, + fit: BoxFit.cover, + ), + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/pages/pharmacies/screens/phramacy-product-detail-page.dart b/lib/pages/pharmacies/screens/phramacy-product-detail-page.dart new file mode 100644 index 00000000..afbd2b06 --- /dev/null +++ b/lib/pages/pharmacies/screens/phramacy-product-detail-page.dart @@ -0,0 +1,19 @@ +import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; + +class ProductDetailScreen extends StatelessWidget { + final PharmacyProduct product; + + ProductDetailScreen(this.product); + + @override + Widget build(BuildContext context) { + return AppScaffold( + body: Center( + child: Texts("id = ${product.id}"), + ), + ); + } +} diff --git a/lib/pages/pharmacies/widgets/BannerPager.dart b/lib/pages/pharmacies/widgets/BannerPager.dart new file mode 100644 index 00000000..989c7557 --- /dev/null +++ b/lib/pages/pharmacies/widgets/BannerPager.dart @@ -0,0 +1,88 @@ +import 'package:carousel_slider/carousel_slider.dart'; +import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart'; +import 'package:flutter/material.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; + +class BannerPager extends StatefulWidget { + final PharmacyModuleViewModel _model; + + BannerPager(this._model); + + @override + _BannerPagerState createState() => _BannerPagerState(); +} + +class _BannerPagerState extends State { + int _current = 0; + + @override + Widget build(BuildContext context) { + return Container( + child: Column( + children: [ + CarouselSlider( + options: CarouselOptions( + aspectRatio: 7 / 2, + enlargeCenterPage: true, + enableInfiniteScroll: false, + initialPage: 0, + autoPlay: true, + autoPlayInterval: Duration(seconds: 3), + autoPlayAnimationDuration: Duration(milliseconds: 800), + autoPlayCurve: Curves.decelerate, + onPageChanged: (index, reason) { + setState(() { + _current = index; + }); + }, + ), + items: widget._model + .getBannerImagesUrl() + .mapIndexed( + (item, index) => Container( + margin: EdgeInsets.symmetric(horizontal: 1.0), + child: ClipRRect( + borderRadius: BorderRadius.all(Radius.circular(5.0)), + child: Center( + child: index == 0 + ? Image.asset( + item, + fit: BoxFit.cover, + ) + : Image.network( + item, + fit: BoxFit.cover, + ), + ), + ), + ), + ) + .toList(), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: widget._model + .getBannerImagesUrl() + .mapIndexed( + (item, index) => Container( + width: 12.0, + height: 4.0, + margin: + EdgeInsets.symmetric(vertical: 0.0, horizontal: 2.0), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: _current == index + ? Color.fromRGBO(0, 250, 0, 0.9) + : Color.fromRGBO(0, 0, 0, 0.4), + ), + ), + ) + .toList(), + ), + ) + ], + )); + } +} diff --git a/lib/pages/pharmacies/widgets/ProductOrderItem.dart b/lib/pages/pharmacies/widgets/ProductOrderItem.dart new file mode 100644 index 00000000..81b6068a --- /dev/null +++ b/lib/pages/pharmacies/widgets/ProductOrderItem.dart @@ -0,0 +1,13 @@ +import 'package:flutter/material.dart'; + +class ProductOrderItem extends StatelessWidget { + @override + Widget build(BuildContext context) { + return ListTile( + leading: Icon( + Icons.delete_outline_sharp, + color: Colors.grey.shade800, + ), + ); + } +} diff --git a/lib/pages/pharmacies/widgets/ProductTileItem.dart b/lib/pages/pharmacies/widgets/ProductTileItem.dart new file mode 100644 index 00000000..62493387 --- /dev/null +++ b/lib/pages/pharmacies/widgets/ProductTileItem.dart @@ -0,0 +1,146 @@ +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/screens/phramacy-product-detail-page.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/StarRating.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class ProductTileItem extends StatelessWidget { + final AppSharedPreferences sharedPref = AppSharedPreferences(); + final PharmacyProduct item; + + ProductTileItem(this.item); + + void productOnClick(BuildContext ctx) { + _saveLastVisitProducts(); + Navigator.push(ctx, FadePage(page: ProductDetailScreen(item))); + } + + void _saveLastVisitProducts() async { + String lastVisited = ""; + bool isIdExist = false; + if (await this.sharedPref.getString(PHARMACY_LAST_VISITED_PRODUCTS) != + null) { + lastVisited = + await this.sharedPref.getString(PHARMACY_LAST_VISITED_PRODUCTS); + lastVisited.split(",").forEach((id) { + if (id == item.id) { + isIdExist = true; + } + }); + } + if (!isIdExist) { + if (lastVisited == "") { + // it means there is no lastVisited yet + lastVisited = "${item.id}"; + } else { + // there is lastVisited id's and this product id is not found + lastVisited += ",${item.id}"; + } + sharedPref.setString(PHARMACY_LAST_VISITED_PRODUCTS, lastVisited); + } + } + + @override + Widget build(BuildContext context) { + ProjectViewModel projectProvider = Provider.of(context); + return InkWell( + onTap: () => productOnClick(context), + splashColor: Theme.of(context).primaryColor, + child: Card( + elevation: 2, + shape: Border(right: BorderSide(color: Colors.grey.shade300, width: 1)), + margin: EdgeInsets.symmetric( + horizontal: 8, + vertical: 4, + ), + child: Container( + 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( + item.images[0].src, + fit: BoxFit.cover, + height: 80, + ), + ), + Container( + width: item.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( + item.rxMessage != null ? item.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( + projectProvider.isArabic ? item.name : item.namen, + regular: true, + fontSize: 12, + fontWeight: FontWeight.w400, + ), + Padding( + padding: const EdgeInsets.only(top: 4, bottom: 4), + child: Texts( + "SAR ${item.price}", + bold: true, + fontSize: 14, + ), + ), + Row( + children: [ + 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/manufacturerItem.dart b/lib/pages/pharmacies/widgets/manufacturerItem.dart new file mode 100644 index 00000000..7ffa3d89 --- /dev/null +++ b/lib/pages/pharmacies/widgets/manufacturerItem.dart @@ -0,0 +1,35 @@ +import 'package:diplomaticquarterapp/core/model/pharmacies/Manufacturer.dart'; +import 'package:flutter/material.dart'; + +class ManufacturerItem extends StatelessWidget { + final Manufacturer item; + + ManufacturerItem(this.item); + + @override + Widget build(BuildContext context) { + return Card( + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)), + margin: EdgeInsets.symmetric( + horizontal: 8, + vertical: 4, + ), + child: Container( + decoration: BoxDecoration( + border: Border( + right: BorderSide(color: Colors.grey.shade300, width: 1), + bottom: BorderSide(color: Colors.grey.shade300, width: 1), + left: BorderSide(color: Colors.grey.shade300, width: 1), + top: BorderSide(color: Colors.grey.shade300, width: 1)), + ), + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 8), + child: Image.network( + item.image.src, + fit: BoxFit.cover, + ), + ), + ), + ); + } +} diff --git a/lib/pages/rateAppointment/rate_appointment_doctor.dart b/lib/pages/rateAppointment/rate_appointment_doctor.dart index 83674906..d36ef9db 100644 --- a/lib/pages/rateAppointment/rate_appointment_doctor.dart +++ b/lib/pages/rateAppointment/rate_appointment_doctor.dart @@ -100,7 +100,7 @@ class _RateAppointmentDoctorState extends State { height: 4, ), Texts( - model.appointmentDetails.clinicName, + model.appointmentDetails.clinicName??'', bold: true, ), SizedBox( diff --git a/lib/pages/symptom-checker/info.dart b/lib/pages/symptom-checker/info.dart new file mode 100644 index 00000000..7906ba1a --- /dev/null +++ b/lib/pages/symptom-checker/info.dart @@ -0,0 +1,131 @@ +import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; +import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart'; +import 'package:diplomaticquarterapp/widgets/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/routes.dart'; + +class SymptomInfo extends StatefulWidget { + @override + _SymptomInfo createState() => new _SymptomInfo(); +} + +class _SymptomInfo extends State { + bool checkValue = false; + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: TranslationBase.of(context).termsService, + isShowAppBar: true, + body: Padding( + padding: EdgeInsets.all(20), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).beforeUsing, + fontWeight: FontWeight.bold, + fontSize: 14, + // textAlign: TextAlign.center, + ), + Container( + width: MediaQuery.of(context).size.width, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), + color: Colors.white, + ), + padding: EdgeInsets.all(30), + margin: EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + AppText(TranslationBase.of(context).remeberthat, + fontSize: 16), + SizedBox( + height: 10, + ), + AppText( + '1. ' + TranslationBase.of(context).checkDiagnosis, + fontWeight: FontWeight.bold, + fontSize: 16, + ), + AppText(TranslationBase.of(context).informational, + fontSize: 16), + SizedBox( + height: 10, + ), + AppText( + '2. ' + TranslationBase.of(context).notUseInEmbergency, + fontWeight: FontWeight.bold, + fontSize: 16, + ), + AppText( + TranslationBase.of(context).notUseInEmbergencyDetails, + fontSize: 16), + AppText( + TranslationBase.of(context).notUseInEmbergencyCall, + underline: true, + color: Colors.blue, + fontSize: 16), + SizedBox( + height: 10, + ), + AppText( + '3.' + TranslationBase.of(context).dataSafe, + fontWeight: FontWeight.bold, + fontSize: 16, + ), + AppText(TranslationBase.of(context).dataSafeInfo, + fontSize: 16), + ], + ), + ), + Expanded( + flex: 1, + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Padding( + padding: EdgeInsets.all(10), + child: CheckboxListTile( + title: AppText(TranslationBase.of(context).accept), + value: checkValue, + onChanged: (newValue) { + setState(() { + this.checkValue = newValue; + }); + }, + controlAffinity: ListTileControlAffinity + .leading, // <-- leading Checkbox + ), + ), + Row( + children: [ + Expanded( + child: DefaultButton( + TranslationBase.of(context).next, + () => { + if (checkValue == true) + { + Navigator.of(context).pushNamed( + SELECT_GENDER, + ) + } + }, + color: checkValue == true + ? Colors.black + : Colors.grey, + textColor: Colors.white, + )) + ], + ), + ], + )) + ], + ))); + } +} diff --git a/lib/pages/symptom-checker/select-gender.dart b/lib/pages/symptom-checker/select-gender.dart new file mode 100644 index 00000000..0b8be29d --- /dev/null +++ b/lib/pages/symptom-checker/select-gender.dart @@ -0,0 +1,124 @@ +import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; +import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart'; +import 'package:diplomaticquarterapp/widgets/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/routes.dart'; +import 'package:flutter_xlider/flutter_xlider.dart'; + +class SelectGender extends StatefulWidget { + @override + _SelectGender createState() => new _SelectGender(); +} + +class _SelectGender extends State { + double slider = 22; + + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: TranslationBase.of(context).gender, + isShowAppBar: true, + body: Padding( + padding: EdgeInsets.all(20), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + //TranslationBase.of(context).beforeUsing, + TranslationBase.of(context).selectGender, + fontWeight: FontWeight.bold, + fontSize: 20, + // textAlign: TextAlign.center, + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + AppText(TranslationBase.of(context).iAma, fontSize: 16), + SizedBox( + height: 10, + ), + Row( + children: [ + Expanded( + child: Container( + height: 200, + width: 150, + child: Card( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(15.0), + ), + shadowColor: Colors.red, + child: Image.asset( + 'assets/images/female_face.png')))), + Expanded( + child: Container( + height: 200, + width: 150, + child: Card( + shadowColor: Colors.red, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(15.0), + ), + child: Image.asset( + 'assets/images/male_face.png')))) + ], + ), + AppText(TranslationBase.of(context).selectAge, + fontSize: 25), + SizedBox( + height: 10, + ), + AppText( + TranslationBase.of(context).iAm + + ' ' + + slider.toString() + + ' ' + + TranslationBase.of(context) + .yearOld, //TranslationBase.of(context).remeberthat, + fontSize: 16), + SizedBox( + height: 30, + ), + FlutterSlider( + values: [slider], + max: 90, + min: 14, + onDragCompleted: (handlerIndex, lowerValue, upperValue) { + print(lowerValue); + print(upperValue); + setState(() { + slider = upperValue; + }); + }, + ), + ], + ), + Expanded( + flex: 1, + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Row( + children: [ + Expanded( + child: DefaultButton( + TranslationBase.of(context).next, + () => { + Navigator.of(context).pushNamed( + SYMPTOM_CHECKER, + ) + }, + )) + ], + ), + ], + )) + ], + ))); + } +} diff --git a/lib/pages/symptom-checker/symtom-checker.dart b/lib/pages/symptom-checker/symtom-checker.dart index f7475abf..c088caab 100644 --- a/lib/pages/symptom-checker/symtom-checker.dart +++ b/lib/pages/symptom-checker/symtom-checker.dart @@ -1,3 +1,5 @@ +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:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -10,7 +12,10 @@ class SymptomChecker extends StatelessWidget { isShowAppBar: true, appBarTitle: 'Symptom Checker', body: Center( - child: SvgPicture.string( + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + SvgPicture.string( ''' @@ -38,6 +43,19 @@ class SymptomChecker extends StatelessWidget { -'''))); +'''), + Padding( + padding: EdgeInsets.all(10), + child: Row( + children: [ + Expanded( + child: DefaultButton( + TranslationBase.of(context).next, + () => {}, + )) + ], + )) + ], + ))); } } diff --git a/lib/routes.dart b/lib/routes.dart index 8d109983..ada7c54c 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -10,6 +10,8 @@ import 'package:diplomaticquarterapp/pages/login/login.dart'; import 'package:diplomaticquarterapp/pages/login/register.dart'; import 'package:diplomaticquarterapp/pages/family/add-family_type.dart'; import 'package:diplomaticquarterapp/pages/family/add-family-member.dart'; +import 'package:diplomaticquarterapp/pages/symptom-checker/info.dart'; +import 'package:diplomaticquarterapp/pages/symptom-checker/select-gender.dart'; import 'package:diplomaticquarterapp/pages/symptom-checker/symtom-checker.dart'; const String INIT_ROUTE = '/'; @@ -27,6 +29,8 @@ const String ADD_FAMILY_MEMBER_TYPE = 'add-family-member-type'; const String ADD_FAMILY_MEMBER = 'add-family-member'; const String LIVE_CARE = 'live-care'; const String SYMPTOM_CHECKER = 'symptom-checker'; +const String SYMPTOM_CHECKER_INFO = 'symptom-checker-info'; +const String SELECT_GENDER = 'select-gender'; var routes = { HOME: (_) => LandingPage(), WELCOME_LOGIN: (_) => WelcomeLogin(), @@ -40,5 +44,7 @@ var routes = { ADD_FAMILY_MEMBER_TYPE: (_) => AddFamilyMemberType(), ADD_FAMILY_MEMBER: (_) => AddMember(), LIVE_CARE: (_) => LiveCareHome(), - SYMPTOM_CHECKER: (_) => SymptomChecker() + SYMPTOM_CHECKER: (_) => SymptomChecker(), + SYMPTOM_CHECKER_INFO: (_) => SymptomInfo(), + SELECT_GENDER: (_) => SelectGender() }; diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index 4b5dc264..39117783 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -66,7 +66,8 @@ class DoctorsListService extends BaseService { // "Latitude": 0, // "Longitude": 0, // "License": true, - "IsVoiceCommand": doctorId != null && doctorId.length > 0 ? true : false, + "SearchForVoiceCommand": + doctorId != null && doctorId.length > 0 ? true : false, "DoctorIDsList": doctorId, "Latitude": lat != null ? lat.toString() : 0, "Longitude": long != null ? long.toString() : 0, @@ -212,8 +213,8 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future getDoctorScheduledFreeSlots( - int docID, int clinicID, int projectID, int serviceID, BuildContext context) async { + Future getDoctorScheduledFreeSlots(int docID, int clinicID, + int projectID, int serviceID, BuildContext context) async { Map request; var languageID = await sharedPref.getString(APP_LANGUAGE); Request req = appGlobal.getPublicRequest(); @@ -241,10 +242,10 @@ class DoctorsListService extends BaseService { await baseAppClient.post(GET_LIVECARE_SCHEDULE_DOCTOR_TIME_SLOTS, onSuccess: (response, statusCode) async { - localRes = response; - }, onFailure: (String error, int statusCode) { - throw error; - }, body: request); + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); return Future.value(localRes); } @@ -301,8 +302,14 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future insertLiveCareScheduleAppointment(int docID, int clinicID, int projectID, int serviceID, - String selectedTime, String selectedDate, BuildContext context) async { + Future insertLiveCareScheduleAppointment( + int docID, + int clinicID, + int projectID, + int serviceID, + String selectedTime, + String selectedDate, + BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { @@ -348,10 +355,10 @@ class DoctorsListService extends BaseService { await baseAppClient.post(INSERT_LIVECARE_SCHEDULE_APPOINTMENT, onSuccess: (response, statusCode) async { - localRes = response; - }, onFailure: (String error, int statusCode) { - throw error; - }, body: request); + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); return Future.value(localRes); } @@ -437,10 +444,10 @@ class DoctorsListService extends BaseService { await baseAppClient.post(GET_PATIENT_SHARE_LIVECARE, onSuccess: (response, statusCode) async { - localRes = response['OnlineCheckInAppointments'][0]; - }, onFailure: (String error, int statusCode) { - throw error; - }, body: request); + localRes = response['OnlineCheckInAppointments'][0]; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); return Future.value(localRes); } @@ -519,8 +526,8 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future confirmAppointment( - int appoNo, int clinicID, int projectID, bool isLiveCare, BuildContext context) async { + Future confirmAppointment(int appoNo, int clinicID, int projectID, + bool isLiveCare, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { @@ -564,9 +571,8 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - - Future insertVIDARequest( - int appoNo, int clinicID, int projectID, int serviceID, int docID, BuildContext context) async { + Future insertVIDARequest(int appoNo, int clinicID, int projectID, + int serviceID, int docID, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { @@ -613,10 +619,10 @@ class DoctorsListService extends BaseService { await baseAppClient.post(INSERT_VIDA_REQUEST, onSuccess: (response, statusCode) async { - localRes = response; - }, onFailure: (String error, int statusCode) { - throw error; - }, body: request); + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); return Future.value(localRes); } diff --git a/lib/services/smartwatch_integration/SmartWatchIntegrationService.dart b/lib/services/smartwatch_integration/SmartWatchIntegrationService.dart new file mode 100644 index 00000000..315249c8 --- /dev/null +++ b/lib/services/smartwatch_integration/SmartWatchIntegrationService.dart @@ -0,0 +1,54 @@ +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/Request.dart'; +import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:flutter/material.dart'; + +class SmartWatchIntegrationService extends BaseService { + AppSharedPreferences sharedPref = AppSharedPreferences(); + AppGlobal appGlobal = new AppGlobal(); + + AuthenticatedUser authUser = new AuthenticatedUser(); + AuthProvider authProvider = new AuthProvider(); + + Future getLastPatientRecord(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.getString(APP_LANGUAGE); + 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": "YckwoXhUmWBsnHKEKig", + "PatientID": authUser.patientID != null ? authUser.patientID : 0, + "License": true + }; + + dynamic localRes; + + await baseAppClient.post(GET_PATIENT_LAST_RECORD, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + + } +} diff --git a/lib/uitl/date_uitl.dart b/lib/uitl/date_uitl.dart index 0155ff10..8ffaf97c 100644 --- a/lib/uitl/date_uitl.dart +++ b/lib/uitl/date_uitl.dart @@ -27,6 +27,14 @@ class DateUtil { return start + "$milliseconds" + end; } + static String convertDateToStringLocation(DateTime date) { + const start = "/Date("; + const end = ")/"; + int milliseconds = date.millisecondsSinceEpoch; + + return start + "$milliseconds" + end; + } + static String yearMonthDay(DateTime dateTime) { String dateFormat = '${dateTime.year}-${dateTime.month}-${dateTime.day}'; return dateFormat; @@ -257,6 +265,7 @@ class DateUtil { break; case DayOfWeek.Sunday: return "Sunday"; + break; } return ""; diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 37aa6732..932ad3fa 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -1,6 +1,7 @@ import 'dart:async'; import 'package:diplomaticquarterapp/config/localized_values.dart'; +import 'package:diplomaticquarterapp/pages/symptom-checker/select-gender.dart'; import 'package:flutter/foundation.dart' show SynchronousFuture; import 'package:flutter/material.dart'; @@ -716,14 +717,21 @@ class TranslationBase { 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 shippingAddress => localizedValues['shippingAddress'][locale.languageCode]; - String get shippedMethod => localizedValues['shippedMethod'][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 shippingAddress => + localizedValues['shippingAddress'][locale.languageCode]; + String get shippedMethod => + localizedValues['shippedMethod'][locale.languageCode]; String get orderDetail => localizedValues['orderDetail'][locale.languageCode]; - String get orderSummary => localizedValues['orderSummary'][locale.languageCode]; + String get orderSummary => + localizedValues['orderSummary'][locale.languageCode]; String get subtotal => localizedValues['subtotal'][locale.languageCode]; String get shipping => localizedValues['shipping'][locale.languageCode]; String get vat => localizedValues['vat'][locale.languageCode]; @@ -731,11 +739,67 @@ class TranslationBase { 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 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 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 => localizedValues['info-radiology'][locale.languageCode]; + + // pharmacy module + // String get medicationRefill => localizedValues['medicationRefill'][locale.languageCode]; + String get offersAndPromotions => + localizedValues['offersAndPromotions'][locale.languageCode]; + // String get myPrescriptions => localizedValues['myPrescriptions'][locale.languageCode]; + String get searchAndScanMedication => + localizedValues['searchAndScanMedication'][locale.languageCode]; + String get shopByBrands => + 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 beforeUsing => localizedValues['Beforeusing'][locale.languageCode]; + String get accept => localizedValues['accept'][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 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 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]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/uitl/utils.dart b/lib/uitl/utils.dart index 33a1d072..3b9fa975 100644 --- a/lib/uitl/utils.dart +++ b/lib/uitl/utils.dart @@ -1,4 +1,7 @@ import 'dart:convert'; +import 'dart:core'; +import 'dart:core'; +import 'dart:core'; import 'dart:typed_data'; import 'package:connectivity/connectivity.dart'; @@ -152,4 +155,22 @@ class Utils { static Uint8List dataFromBase64String(String base64String) { return base64Decode(base64String); } + +} +// 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) { + var i = 0; + return map((e) => f(e, i++)); + } } +/* + userBoard.asMap().map((i, element) => MapEntry(i, Stack( + GestureDetector(onTap: () { + setState(() { + // print("element=${element.toString()}"); + // print("element=${userBoard[i].toString()}"); + }); + }), + ))).values.toList(); + */ diff --git a/lib/widgets/buttons/GestureIconButton.dart b/lib/widgets/buttons/GestureIconButton.dart new file mode 100644 index 00000000..841d7ea6 --- /dev/null +++ b/lib/widgets/buttons/GestureIconButton.dart @@ -0,0 +1,70 @@ +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/material.dart'; + +class GestureIconButton extends StatefulWidget { + GestureIconButton( + this.label, + this.icon, { + Key key, + this.onTap, + this.backgroundColor, + }) : super(key: key); + + final String label; + final Widget icon; + final VoidCallback onTap; + final Color backgroundColor; + + @override + _GestureIconButtonState createState() => _GestureIconButtonState(); +} + +class _GestureIconButtonState extends State { + bool _buttonLongPress = false; + + @override + Widget build(BuildContext context) { + return GestureDetector( + onLongPressStart: (_) => + setState(() => _buttonLongPress = !_buttonLongPress), + onLongPressEnd: (_) => + setState(() => _buttonLongPress = !_buttonLongPress), + child: Wrap( + children: [ + Container( + decoration: BoxDecoration( + border: Border.all( + color: widget.backgroundColor != null + ? widget.backgroundColor + : Colors.grey[200], + ), + color: widget.backgroundColor != null + ? widget.backgroundColor + : Colors.grey.shade200, + borderRadius: BorderRadius.all(Radius.circular(8))), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + child: Expanded( + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + Padding( + padding: const EdgeInsets.only(right: 8.0), + child: widget.icon, + ), + Texts( + widget.label, + color: _buttonLongPress ? Colors.white : Colors.black, + ), + ], + ), + ), + ), + ), + ), + ], + ), + ); + } +} diff --git a/lib/widgets/buttons/borderedButton.dart b/lib/widgets/buttons/borderedButton.dart new file mode 100644 index 00000000..5e05448e --- /dev/null +++ b/lib/widgets/buttons/borderedButton.dart @@ -0,0 +1,59 @@ +import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:flutter/material.dart'; + +class BorderedButton extends StatelessWidget { + final String text; + final Function handler; + final Color color; + final bool hasBorder; + final Color borderColor; + final Color backgroundColor; + final double vPadding; + final double hPadding; + + BorderedButton( + this.text, { + this.handler, + this.color, + this.hasBorder = false, + this.borderColor, + this.backgroundColor, + this.vPadding = 0, + this.hPadding = 0, + }); + + @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), + ), + ), //your original button + ), + ); + } +} diff --git a/lib/widgets/data_display/text.dart b/lib/widgets/data_display/text.dart index 4b9fc551..215db9ff 100644 --- a/lib/widgets/data_display/text.dart +++ b/lib/widgets/data_display/text.dart @@ -257,11 +257,17 @@ class _TextsState extends State { hidden = !hidden; }); }, - child: Text(hidden ? "Read More" : "Read less", - style: _getFontStyle().copyWith( - color: Theme.of(context).primaryColor, - fontWeight: FontWeight.w800, - fontFamily: "WorkSans")), + child: Text( + hidden ? "Read More" : "Read less", + style: _getFontStyle().copyWith( + color: Theme.of(context).primaryColor, + fontWeight: FontWeight.w800, + fontFamily: + Localizations.localeOf(context).languageCode == 'ar' + ? 'Cairo' + : 'WorkSans', + ), + ), ), ), ], diff --git a/lib/widgets/others/app_scaffold_widget.dart b/lib/widgets/others/app_scaffold_widget.dart index 3ebd84d8..acaa056a 100644 --- a/lib/widgets/others/app_scaffold_widget.dart +++ b/lib/widgets/others/app_scaffold_widget.dart @@ -36,6 +36,7 @@ class AppScaffold extends StatelessWidget { final String title; final String description; final bool isShowDecPage; + final Color backgroundColor; AuthenticatedUserObject authenticatedUserObject = locator(); @@ -52,14 +53,15 @@ class AppScaffold extends StatelessWidget { this.isPharmacy = false, this.title, this.description, - this.isShowDecPage = true, this.isBottomBar}); + this.isShowDecPage = true, + this.isBottomBar,this.backgroundColor}); @override Widget build(BuildContext context) { AppGlobal.context = context; return Scaffold( - backgroundColor: Theme.of(context).scaffoldBackgroundColor, + backgroundColor: backgroundColor ?? Theme.of(context).scaffoldBackgroundColor, appBar: isShowAppBar ? AppBar( elevation: 0, @@ -72,7 +74,8 @@ class AppScaffold extends StatelessWidget { ), title: Text(authenticatedUserObject.isLogin ? appBarTitle.toUpperCase() - : TranslationBase.of(context).serviceInformationTitle),leading: Builder( + : TranslationBase.of(context).serviceInformationTitle), + leading: Builder( builder: (BuildContext context) { return ArrowBack(); }, @@ -106,7 +109,7 @@ class AppScaffold extends StatelessWidget { ) : buildBodyWidget(), bottomSheet: bottomSheet, - floatingActionButton: floatingActionButton ?? floatingActionButton, + //floatingActionButton: floatingActionButton ?? floatingActionButton, // bottomNavigationBar: // this.isBottomBar == true ? BottomBarSearch() : SizedBox() // floatingActionButton: FloatingSearchButton(), @@ -119,6 +122,6 @@ class AppScaffold extends StatelessWidget { buildBodyWidget() { // return body; //Stack(children: [body, buildAppLoaderWidget(isLoading)]); - return Stack(children: [body, FloatingSearchButton()]); + return Stack(children: [body, /*FloatingSearchButton()*/]); } } diff --git a/lib/widgets/others/close_back.dart b/lib/widgets/others/close_back.dart index 78fe0c86..75fe05e8 100644 --- a/lib/widgets/others/close_back.dart +++ b/lib/widgets/others/close_back.dart @@ -16,7 +16,7 @@ class CloseBack extends StatelessWidget{ onTap: Feedback.wrapForTap(() { onTap!=null ? onTap() : Navigator.pop(context); }, context), - child: Icon(EvaIcons.close, color: Color.fromRGBO(78, 62, 253, 1.0)), + child: Icon(EvaIcons.close, color: Colors.white), ); } } \ No newline at end of file diff --git a/lib/widgets/pickupLocation/PickupLocationFromMap.dart b/lib/widgets/pickupLocation/PickupLocationFromMap.dart new file mode 100644 index 00000000..d8c93441 --- /dev/null +++ b/lib/widgets/pickupLocation/PickupLocationFromMap.dart @@ -0,0 +1,78 @@ +import 'package:diplomaticquarterapp/config/config.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/others/close_back.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:google_maps_place_picker/google_maps_place_picker.dart'; +import 'package:google_maps_flutter/google_maps_flutter.dart'; +import 'package:provider/provider.dart'; + +class PickupLocationFromMap extends StatelessWidget { + final Function(PickResult) onPick; + final double latitude; + final double longitude; + + const PickupLocationFromMap({Key key, this.onPick, this.latitude, this.longitude}) + : super(key: key); + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return Scaffold( + appBar: AppBar( + elevation: 0, + textTheme: TextTheme( + headline6: + TextStyle(color: Colors.white, fontWeight: FontWeight.bold), + ), + title: Text('Location'), + leading: CloseBack(), + centerTitle: true, + ), + body: PlacePicker( + apiKey: GOOGLE_API_KEY, + enableMyLocationButton: true, + automaticallyImplyAppBarLeading: false, + autocompleteLanguage: projectViewModel.currentLanguage, + enableMapTypeButton: true, + selectInitialPosition: true, + onPlacePicked: (PickResult result) { + print(result.adrAddress); + onPick(result); + Navigator.of(context).pop(); + }, + selectedPlaceWidgetBuilder: + (_, selectedPlace, state, isSearchBarFocused) { + print("state: $state, isSearchBarFocused: $isSearchBarFocused"); + return isSearchBarFocused + ? Container() + : FloatingCard( + bottomPosition: 0.0, + leftPosition: 0.0, + rightPosition: 0.0, + width: 500, + borderRadius: BorderRadius.circular(12.0), + child: state == SearchingState.Searching + ? Center(child: CircularProgressIndicator()) + : Container( + margin: EdgeInsets.all(12), + child: SecondaryButton( + color: Colors.grey[800], + textColor: Colors.white, + onTap: () { + onPick(selectedPlace); + Navigator.of(context).pop(); + }, + label: TranslationBase.of(context).next, + ), + ), + ); + }, + initialPosition: LatLng(latitude, longitude), + useCurrentLocation: true, + ), + ); + } +} diff --git a/pubspec.yaml b/pubspec.yaml index 0c91972c..42838d52 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -70,13 +70,19 @@ dependencies: # Notification Banner dropdown_banner: ^1.4.0 + flutter_xlider: ^3.4.0 # flutter_local_notifications: # charts charts_flutter: ^0.9.0 - # Qr code Scanner - barcode_scan: ^3.0.1 + #image banner slider + carousel_slider: ^2.3.1 + + google_maps_flutter: ^1.0.3 + + # Qr code Scanner TODO fix it + #barcode_scan: ^3.0.1 # Rating Stars rating_bar: ^0.2.0 @@ -136,7 +142,7 @@ dependencies: #google maps places - google_maps_place_picker: ^0.10.0 + google_maps_place_picker: ^1.0.0 #google maps places google_maps_flutter: ^0.5.28+1 @@ -174,14 +180,40 @@ flutter: - assets/sounds/ - assets/images/svg/ - assets/tracker/ + - assets/images/AlHabibMedicalService/ + - assets/images/pharmacy_module/ fonts: - family: WorkSans fonts: - - asset: assets/fonts/Work_Sans/WorkSans-Regular.ttf - - asset: assets/fonts/Work_Sans/WorkSans-Bold.ttf - - asset: assets/fonts/Work_Sans/WorkSans-Bold.ttf + - asset: assets/fonts/en/WorkSans-Light/WorkSans-Light_0.eot + - asset: assets/fonts/en/WorkSans-Light/WorkSans-Light_0.otf + - asset: assets/fonts/en/WorkSans-Light/WorkSans-Light_0.ttf + - asset: assets/fonts/en/WorkSans-Light/WorkSans-Light_0.woff + weight: 300 + - asset: assets/fonts/en/WorkSans-Light/WorkSans-Regular.otf + - asset: assets/fonts/en/WorkSans-Light/WorkSans-Regular.ttf + - asset: assets/fonts/en/WorkSans-Light/WorkSans-Regular.woff + weight: 400 + - asset: assets/fonts/en/WorkSans-Bold/WorkSans-Bold.eot + - asset: assets/fonts/en/WorkSans-Bold/WorkSans-Bold.otf + - asset: assets/fonts/en/WorkSans-Bold/WorkSans-Bold.ttf + - asset: assets/fonts/en/WorkSans-Bold/WorkSans-Bold.woff + weight: 700 + + - family: Cairo + fonts: + - asset: assets/fonts/ar/Cairo-Light/Cairo-Light.eot + - asset: assets/fonts/ar/Cairo-Light/Cairo-Light.otf + - asset: assets/fonts/ar/Cairo-Light/Cairo-Light.ttf + - asset: assets/fonts/ar/Cairo-Light/Cairo-Light.woff + weight: 300 + + - asset: assets/fonts/ar/Cairo-Bold/Cairo-Bold.eot + - asset: assets/fonts/ar/Cairo-Bold/Cairo-Bold.otf + - asset: assets/fonts/ar/Cairo-Bold/Cairo-Bold.ttf + - asset: assets/fonts/ar/Cairo-Bold/Cairo-Bold.woff weight: 700 - family: DQIcons diff --git a/sleep_data.png b/sleep_data.png new file mode 100644 index 00000000..dc6661d6 Binary files /dev/null and b/sleep_data.png differ