diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 884c7e09..f1a5a3f8 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -15,7 +15,8 @@ - + + + + + + + + + + + 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 b8a87c8c..35ce314d 100644 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/MainActivity.kt +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/MainActivity.kt @@ -1,11 +1,36 @@ package com.cloud.diplomaticquarterapp -import androidx.annotation.NonNull; - import io.flutter.embedding.android.FlutterFragmentActivity - import io.flutter.embedding.engine.FlutterEngine - import io.flutter.plugins.GeneratedPluginRegistrant +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 -class MainActivity: FlutterFragmentActivity() { - override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) { - GeneratedPluginRegistrant.registerWith(flutterEngine); - } +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)) + } + } } \ No newline at end of file diff --git a/android/app/src/main/res/drawable/app_icon.png b/android/app/src/main/res/drawable/app_icon.png new file mode 100644 index 00000000..c4cc798d Binary files /dev/null and b/android/app/src/main/res/drawable/app_icon.png differ diff --git a/android/app/src/main/res/drawable/food.png b/android/app/src/main/res/drawable/food.png new file mode 100644 index 00000000..41b394d3 Binary files /dev/null and b/android/app/src/main/res/drawable/food.png differ diff --git a/android/app/src/main/res/drawable/me.png b/android/app/src/main/res/drawable/me.png new file mode 100644 index 00000000..ba75bc55 Binary files /dev/null and b/android/app/src/main/res/drawable/me.png differ diff --git a/android/app/src/main/res/drawable/sample_large_icon.png b/android/app/src/main/res/drawable/sample_large_icon.png new file mode 100644 index 00000000..f354ca23 Binary files /dev/null and b/android/app/src/main/res/drawable/sample_large_icon.png differ diff --git a/android/app/src/main/res/drawable/secondary_icon.png b/android/app/src/main/res/drawable/secondary_icon.png new file mode 100644 index 00000000..9de9ff41 Binary files /dev/null and b/android/app/src/main/res/drawable/secondary_icon.png differ diff --git a/android/app/src/main/res/raw/keep.xml b/android/app/src/main/res/raw/keep.xml new file mode 100644 index 00000000..944a7ace --- /dev/null +++ b/android/app/src/main/res/raw/keep.xml @@ -0,0 +1,3 @@ + + \ No newline at end of file diff --git a/android/app/src/main/res/raw/slow_spring_board.mp3 b/android/app/src/main/res/raw/slow_spring_board.mp3 new file mode 100644 index 00000000..60dbf979 Binary files /dev/null and b/android/app/src/main/res/raw/slow_spring_board.mp3 differ diff --git a/assets/images/medical/active_medications.png b/assets/images/medical/active_medications.png new file mode 100644 index 00000000..67122598 Binary files /dev/null and b/assets/images/medical/active_medications.png differ diff --git a/assets/images/medical/ask_doctor_icon.png b/assets/images/medical/ask_doctor_icon.png new file mode 100644 index 00000000..bcb1f279 Binary files /dev/null and b/assets/images/medical/ask_doctor_icon.png differ diff --git a/assets/images/medical/check-in.png b/assets/images/medical/check-in.png new file mode 100644 index 00000000..f6effbeb Binary files /dev/null and b/assets/images/medical/check-in.png differ diff --git a/assets/images/new-design/eye_measurement_icon.png b/assets/images/medical/eye_measurement_icon.png similarity index 100% rename from assets/images/new-design/eye_measurement_icon.png rename to assets/images/medical/eye_measurement_icon.png diff --git a/assets/images/medical/insurance_update_icon_.png b/assets/images/medical/insurance_update_icon_.png new file mode 100644 index 00000000..0001bcd2 Binary files /dev/null and b/assets/images/medical/insurance_update_icon_.png differ diff --git a/assets/images/medical/medical_reports_icon.png b/assets/images/medical/medical_reports_icon.png new file mode 100644 index 00000000..ad9c9f7b Binary files /dev/null and b/assets/images/medical/medical_reports_icon.png differ diff --git a/assets/images/medical/monthly_reports_icon.png b/assets/images/medical/monthly_reports_icon.png new file mode 100644 index 00000000..5d51e24c Binary files /dev/null and b/assets/images/medical/monthly_reports_icon.png differ diff --git a/assets/images/medical/my_allergies_icon.png b/assets/images/medical/my_allergies_icon.png new file mode 100644 index 00000000..689b5321 Binary files /dev/null and b/assets/images/medical/my_allergies_icon.png differ diff --git a/assets/images/medical/my_tracker_icon.png b/assets/images/medical/my_tracker_icon.png new file mode 100644 index 00000000..1d46b859 Binary files /dev/null and b/assets/images/medical/my_tracker_icon.png differ diff --git a/assets/images/medical/my_vaccines_icon.png b/assets/images/medical/my_vaccines_icon.png new file mode 100644 index 00000000..23a7352b Binary files /dev/null and b/assets/images/medical/my_vaccines_icon.png differ diff --git a/assets/images/medical/sick_leaves_icons.png b/assets/images/medical/sick_leaves_icons.png new file mode 100644 index 00000000..67a9c937 Binary files /dev/null and b/assets/images/medical/sick_leaves_icons.png differ diff --git a/assets/images/medical/smartwatch_icon.png b/assets/images/medical/smartwatch_icon.png new file mode 100644 index 00000000..c43fe468 Binary files /dev/null and b/assets/images/medical/smartwatch_icon.png differ diff --git a/assets/images/medical/vital_signs.png b/assets/images/medical/vital_signs.png new file mode 100644 index 00000000..7b642d6e Binary files /dev/null and b/assets/images/medical/vital_signs.png differ diff --git a/assets/images/new-design/allergiesDetails.png b/assets/images/new-design/allergiesDetails.png new file mode 100644 index 00000000..fc268c9c Binary files /dev/null and b/assets/images/new-design/allergiesDetails.png differ diff --git a/assets/tracker/blood-pressure.png b/assets/tracker/blood-pressure.png new file mode 100644 index 00000000..7aca3763 Binary files /dev/null and b/assets/tracker/blood-pressure.png differ diff --git a/assets/tracker/blood-suger.png b/assets/tracker/blood-suger.png new file mode 100644 index 00000000..76b1e448 Binary files /dev/null and b/assets/tracker/blood-suger.png differ diff --git a/assets/tracker/devices.png b/assets/tracker/devices.png new file mode 100644 index 00000000..f00f9d95 Binary files /dev/null and b/assets/tracker/devices.png differ diff --git a/assets/tracker/weight.png b/assets/tracker/weight.png new file mode 100644 index 00000000..385fcb81 Binary files /dev/null and b/assets/tracker/weight.png differ diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj deleted file mode 100644 index 5ba52820..00000000 --- a/ios/Runner.xcodeproj/project.pbxproj +++ /dev/null @@ -1,618 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; - 5A016D0DD1095D385566337C /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AC606583E610E227F8186476 /* Pods_Runner.framework */; }; - 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 9705A1C41CF9048500538489 /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 09DDD2020D673759BD0E86B8 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; - 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; - 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; - 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; - 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; - 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; - 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - A8949DBAE70E5B302D91F1DB /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; - AC606583E610E227F8186476 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - E2D9C922B5D0172FE487333D /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 97C146EB1CF9000F007C117D /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 5A016D0DD1095D385566337C /* Pods_Runner.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 0A1F078D9C068A8B18DE1EDB /* Pods */ = { - isa = PBXGroup; - children = ( - A8949DBAE70E5B302D91F1DB /* Pods-Runner.debug.xcconfig */, - E2D9C922B5D0172FE487333D /* Pods-Runner.release.xcconfig */, - 09DDD2020D673759BD0E86B8 /* Pods-Runner.profile.xcconfig */, - ); - name = Pods; - path = Pods; - sourceTree = ""; - }; - 44EDA189DE1BB86E3A41BD4A /* Frameworks */ = { - isa = PBXGroup; - children = ( - AC606583E610E227F8186476 /* Pods_Runner.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - 9740EEB11CF90186004384FC /* Flutter */ = { - isa = PBXGroup; - children = ( - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, - 9740EEB21CF90195004384FC /* Debug.xcconfig */, - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, - 9740EEB31CF90195004384FC /* Generated.xcconfig */, - ); - name = Flutter; - sourceTree = ""; - }; - 97C146E51CF9000F007C117D = { - isa = PBXGroup; - children = ( - 9740EEB11CF90186004384FC /* Flutter */, - 97C146F01CF9000F007C117D /* Runner */, - 97C146EF1CF9000F007C117D /* Products */, - 0A1F078D9C068A8B18DE1EDB /* Pods */, - 44EDA189DE1BB86E3A41BD4A /* Frameworks */, - ); - sourceTree = ""; - }; - 97C146EF1CF9000F007C117D /* Products */ = { - isa = PBXGroup; - children = ( - 97C146EE1CF9000F007C117D /* Runner.app */, - ); - name = Products; - sourceTree = ""; - }; - 97C146F01CF9000F007C117D /* Runner */ = { - isa = PBXGroup; - children = ( - 97C146FA1CF9000F007C117D /* Main.storyboard */, - 97C146FD1CF9000F007C117D /* Assets.xcassets */, - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, - 97C147021CF9000F007C117D /* Info.plist */, - 97C146F11CF9000F007C117D /* Supporting Files */, - 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, - 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, - 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, - 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, - ); - path = Runner; - sourceTree = ""; - }; - 97C146F11CF9000F007C117D /* Supporting Files */ = { - isa = PBXGroup; - children = ( - ); - name = "Supporting Files"; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 97C146ED1CF9000F007C117D /* Runner */ = { - isa = PBXNativeTarget; - buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; - buildPhases = ( - B4860726BBF5BF6213BBC91C /* [CP] Check Pods Manifest.lock */, - 9740EEB61CF901F6004384FC /* Run Script */, - 97C146EA1CF9000F007C117D /* Sources */, - 97C146EB1CF9000F007C117D /* Frameworks */, - 97C146EC1CF9000F007C117D /* Resources */, - 9705A1C41CF9048500538489 /* Embed Frameworks */, - 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - 72E9699567A7106FD141B9B3 /* [CP] Embed Pods Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Runner; - productName = Runner; - productReference = 97C146EE1CF9000F007C117D /* Runner.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 97C146E61CF9000F007C117D /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 1020; - ORGANIZATIONNAME = ""; - TargetAttributes = { - 97C146ED1CF9000F007C117D = { - CreatedOnToolsVersion = 7.3.1; - LastSwiftMigration = 1100; - }; - }; - }; - buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; - compatibilityVersion = "Xcode 9.3"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 97C146E51CF9000F007C117D; - productRefGroup = 97C146EF1CF9000F007C117D /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 97C146ED1CF9000F007C117D /* Runner */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 97C146EC1CF9000F007C117D /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Thin Binary"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; - }; - 72E9699567A7106FD141B9B3 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", - "${PODS_ROOT}/../Flutter/Flutter.framework", - "${BUILT_PRODUCTS_DIR}/GoogleUtilities/GoogleUtilities.framework", - "${BUILT_PRODUCTS_DIR}/MTBBarcodeScanner/MTBBarcodeScanner.framework", - "${BUILT_PRODUCTS_DIR}/PromisesObjC/FBLPromises.framework", - "${BUILT_PRODUCTS_DIR}/Protobuf/protobuf.framework", - "${BUILT_PRODUCTS_DIR}/Reachability/Reachability.framework", - "${BUILT_PRODUCTS_DIR}/SwiftProtobuf/SwiftProtobuf.framework", - "${BUILT_PRODUCTS_DIR}/TOCropViewController/TOCropViewController.framework", - "${BUILT_PRODUCTS_DIR}/barcode_scan/barcode_scan.framework", - "${BUILT_PRODUCTS_DIR}/connectivity/connectivity.framework", - "${BUILT_PRODUCTS_DIR}/device_info/device_info.framework", - "${BUILT_PRODUCTS_DIR}/flutter_flexible_toast/flutter_flexible_toast.framework", - "${BUILT_PRODUCTS_DIR}/flutter_inappwebview/flutter_inappwebview.framework", - "${BUILT_PRODUCTS_DIR}/flutter_local_notifications/flutter_local_notifications.framework", - "${BUILT_PRODUCTS_DIR}/flutter_plugin_android_lifecycle/flutter_plugin_android_lifecycle.framework", - "${BUILT_PRODUCTS_DIR}/hexcolor/hexcolor.framework", - "${BUILT_PRODUCTS_DIR}/image_cropper/image_cropper.framework", - "${BUILT_PRODUCTS_DIR}/image_picker/image_picker.framework", - "${BUILT_PRODUCTS_DIR}/local_auth/local_auth.framework", - "${BUILT_PRODUCTS_DIR}/manage_calendar_events/manage_calendar_events.framework", - "${BUILT_PRODUCTS_DIR}/map_launcher/map_launcher.framework", - "${BUILT_PRODUCTS_DIR}/nanopb/nanopb.framework", - "${BUILT_PRODUCTS_DIR}/shared_preferences/shared_preferences.framework", - "${BUILT_PRODUCTS_DIR}/url_launcher/url_launcher.framework", - ); - name = "[CP] Embed Pods Frameworks"; - outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleUtilities.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MTBBarcodeScanner.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FBLPromises.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/protobuf.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Reachability.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftProtobuf.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/TOCropViewController.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/barcode_scan.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/connectivity.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/device_info.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_flexible_toast.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_inappwebview.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_local_notifications.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_plugin_android_lifecycle.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/hexcolor.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/image_cropper.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/image_picker.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/local_auth.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/manage_calendar_events.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/map_launcher.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/nanopb.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/shared_preferences.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/url_launcher.framework", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - 9740EEB61CF901F6004384FC /* Run Script */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Run Script"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; - }; - B4860726BBF5BF6213BBC91C /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 97C146EA1CF9000F007C117D /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, - 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 97C146FA1CF9000F007C117D /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C146FB1CF9000F007C117D /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C147001CF9000F007C117D /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 249021D3217E4FDB00AE95B9 /* Profile */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SUPPORTED_PLATFORMS = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Profile; - }; - 249021D4217E4FDB00AE95B9 /* Profile */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - PRODUCT_BUNDLE_IDENTIFIER = com.cloud.diplomaticquarterapp; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Profile; - }; - 97C147031CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 97C147041CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SUPPORTED_PLATFORMS = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 97C147061CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - PRODUCT_BUNDLE_IDENTIFIER = com.cloud.diplomaticquarterapp; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Debug; - }; - 97C147071CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - PRODUCT_BUNDLE_IDENTIFIER = com.cloud.diplomaticquarterapp; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147031CF9000F007C117D /* Debug */, - 97C147041CF9000F007C117D /* Release */, - 249021D3217E4FDB00AE95B9 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147061CF9000F007C117D /* Debug */, - 97C147071CF9000F007C117D /* Release */, - 249021D4217E4FDB00AE95B9 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 97C146E61CF9000F007C117D /* Project object */; -} diff --git a/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 1d526a16..00000000 --- a/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d98100..00000000 --- a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings deleted file mode 100644 index f9b0d7c5..00000000 --- a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +++ /dev/null @@ -1,8 +0,0 @@ - - - - - PreviewsEnabled - - - diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme deleted file mode 100644 index a28140cf..00000000 --- a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ios/Runner.xcworkspace/contents.xcworkspacedata b/ios/Runner.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 21a3cc14..00000000 --- a/ios/Runner.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d98100..00000000 --- a/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings deleted file mode 100644 index f9b0d7c5..00000000 --- a/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +++ /dev/null @@ -1,8 +0,0 @@ - - - - - PreviewsEnabled - - - diff --git a/ios/Runner/AppDelegate.swift b/ios/Runner/AppDelegate.swift deleted file mode 100644 index 70693e4a..00000000 --- a/ios/Runner/AppDelegate.swift +++ /dev/null @@ -1,13 +0,0 @@ -import UIKit -import Flutter - -@UIApplicationMain -@objc class AppDelegate: FlutterAppDelegate { - override func application( - _ application: UIApplication, - didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? - ) -> Bool { - GeneratedPluginRegistrant.register(with: self) - return super.application(application, didFinishLaunchingWithOptions: launchOptions) - } -} diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index 8f1009c3..792eb95e 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -22,6 +22,8 @@ $(FLUTTER_BUILD_NUMBER) LSRequiresIPhoneOS + NSCalendarsUsageDescription + We Need to access the calender to add reminder for you UILaunchStoryboardName LaunchScreen UIMainStoryboardFile diff --git a/ios/Runner/Runner-Bridging-Header.h b/ios/Runner/Runner-Bridging-Header.h deleted file mode 100644 index 308a2a56..00000000 --- a/ios/Runner/Runner-Bridging-Header.h +++ /dev/null @@ -1 +0,0 @@ -#import "GeneratedPluginRegistrant.h" diff --git a/lib/config/config.dart b/lib/config/config.dart index 15f5974b..bcc081c3 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 GET_PROJECT = 'Services/Lists.svc/REST/GetProject'; @@ -177,7 +177,7 @@ const CHANNEL = 3; const GENERAL_ID = 'Cs2020@2016\$2958'; const IP_ADDRESS = '10.20.10.20'; const VERSION_ID = 5.6; -const SETUP_ID = '91877'; +const SETUP_ID = '91877'; const LANGUAGE = 2; const PATIENT_OUT_SA = 0; const SESSION_ID = 'TMRhVmkGhOsvamErw'; @@ -211,6 +211,33 @@ const GET_PATIENT_INFO_BY_ID_AND_MOBILE_NUMBER = 'Services/Patients.svc/REST/AP_ const SEND_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT = 'Services/Authentication.svc/REST/SendActivationCodeForAdvancePayment'; const CHECK_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT = 'Services/Authentication.svc/REST/CheckActivationCodeForAdvancePayment'; +///My Trackers +const GET_DIABETIC_RESULT_AVERAGE='Services/Patients.svc/REST/Patient_GetDiabeticResultAverage'; +const GET_DIABTEC_RESULT='Services/Patients.svc/REST/Patient_GetDiabtecResults'; +const ADD_DIABTEC_RESULT='Services/Patients.svc/REST/Patient_AddDiabtecResult'; + + +const GET_BLOOD_PRESSURE_RESULT_AVERAGE='Services/Patients.svc/REST/Patient_GetBloodPressureResultAverage'; +const GET_BLOOD_PRESSURE_RESULT='Services/Patients.svc/REST/Patient_GetBloodPressureResult'; +const ADD_BLOOD_PRESSURE_RESULT='Services/Patients.svc/REST/Patient_AddBloodPressureResult'; + +const GET_WEIGHT_PRESSURE_RESULT_AVERAGE='Services/Patients.svc/REST/Patient_GetWeightMeasurementResultAverage'; +const GET_WEIGHT_PRESSURE_RESULT='Services/Patients.svc/REST/Patient_GetWeightMeasurementResult'; +const ADD_WEIGHT_PRESSURE_RESULT='Services/Patients.svc/REST/Patient_AddWeightMeasurementResult'; + + +const ADD_ACTIVE_PRESCRIPTIONS_REPORT_BY_PATIENT_ID='Services/Patients.svc/Rest/GetActivePrescriptionReportByPatientID'; + +const GET_CALL_INFO_HOURS_RESULT = 'Services/Doctors.svc/REST/GetCallInfoHoursResult'; +const GET_CALL_REQUEST_TYPE_LOV = 'Services/Doctors.svc/REST/GetCallRequestType_LOV'; +const GET_DOCTOR_RESPONSE = 'Services/Patients.svc/REST/GetDoctorResponse'; +const UPDATE_READ_STATUS = 'Services/Patients.svc/REST/UpdateReadStatus'; +const INSERT_CALL_INFO = 'Services/Doctors.svc/REST/InsertCallInfo'; + +const GET_PATIENT_ALLERGIES = 'Services/Patients.svc/REST/GetPatientAllergies'; + + + // H2O diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index ac7ee547..40840423 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -430,7 +430,7 @@ const Map> localizedValues = { "UpdateInsuranceSubtitle": {"en": "Card", "ar": "التأمين"}, "InsuranceApproval": {"en": "Insurance Approval", "ar": "موافقات"}, "InsuranceApprovalSubtitle": {"en": "Approvals", "ar": "موافقات التأمين"}, - "Allergies": {"en": "Approvals", "ar": "الحساسية"}, + "Allergies": {"en": "Allergies", "ar": "الحساسية"}, "AllergiesSubtitle": {"en": "Diagnosed", "ar": "مسجلة"}, "MyVaccines": {"en": "My Vaccines", "ar": "تطعيماتي"}, "MyVaccinesSubtitle": {"en": "List", "ar": "قائمة"}, @@ -534,4 +534,38 @@ const Map> localizedValues = { "en": "Please enter the verification code send to", "ar": "الرجاء إدخال رمز التحقق المرسل إلى" }, + "EyeMeasurements":{"en":"Eye Measurements","ar":"قياسات النظر"}, + "Measurements":{"en":"Measurements","ar":"قياسات"}, + "Classes":{"en":"Classes","ar":"نظارات"}, + "ContactLens":{"en":"Contact Lens","ar":"العدسات اللاصقة"}, + "RightEye":{"en":"Right Eye","ar":"العين اليمين"}, + "Sphere":{"en":"Sphere","ar":"القوة"}, + "Cylinder":{"en":"Cylinder","ar":"الدائرية"}, + "Axis":{"en":"Axis","ar":"المحاور"}, + "Prism":{"en":"Prism","ar":"موشور"}, + "VA":{"en":"Prism","ar":"المحاور"}, + "LeftEye":{"en":"Left Eye","ar":"العين اليسرى"}, + "Brand":{"en":"Brand","ar":"النوع"}, + "Power":{"en":"Power","ar":"القوة"}, + "Diameter":{"en":"Diameter","ar":"القطر"}, + "Remarks":{"en":"Remarks","ar":"ملاحضات"}, + "ActiveMedications":{"en":"Active Medications","ar":"ادويتي النشطة"}, + "ExpDate":{"en":"Active Exp Date :","VA":"تاريخ الإنتهاء"}, + "Route":{"en":"Route :","ar":"الطريقة"}, + "Frequency":{"en":"Frequency :","ar":"المعدل"}, + "DailyQuantity":{"en":"Daily Quantity :","ar":"جرعات يومية"}, + "AddReminder":{"en":"Add Reminder","ar":"إضافة تذكير"}, + "reminderDes":{"en":"Please select treatment start day and time to be notified when it\'s time to take the medicine","ar":" يرجى تحديد يوم بدء العلاج والوقت ليتم ارسال تنبيه عندما يحين الوقت لتناول الدواء"}, + "StartDay":{"en":"Start Day","ar":"يوم البداية"}, + "EndDay":{"en":"End Day","ar":"يوم الانتهاء"}, + "Days":{"en":"Days ","ar":"أيام"}, + "ScheduleTime":{"en":"Schedule time","ar":"الجدول الزمني"}, + "AskDoctor":{"en":"Ask Doctor","ar":"اسأل طبيبك"}, + "DoctorResponses":{"en":"Doctor Responses","ar":"ردود الأطباء"}, + "New":{"en":"New","ar":"جديد"}, + "All":{"en":"All","ar":"الكل"}, + "QuestionHere":{"en":"Enter the question here...","ar":"اضف الاستفسار هنا"}, + "ViewDoctorResponses":{"en":"View Doctor Responses","ar":"الاطلاع على ردود الأطباء"}, + + }; diff --git a/lib/core/model/Allergy/Allergy.dart b/lib/core/model/Allergy/Allergy.dart new file mode 100644 index 00000000..be71c7fe --- /dev/null +++ b/lib/core/model/Allergy/Allergy.dart @@ -0,0 +1,48 @@ +class Allergy { + int patientID; + int allergyDiseaseType; + int allergyDiseaseID; + String description; + dynamic descriptionN; + dynamic remarks; + dynamic avgDoctorRatingList; + dynamic doctorRatingDetailsList; + dynamic notesDoctorRatingList; + + Allergy( + {this.patientID, + this.allergyDiseaseType, + this.allergyDiseaseID, + this.description, + this.descriptionN, + this.remarks, + this.avgDoctorRatingList, + this.doctorRatingDetailsList, + this.notesDoctorRatingList}); + + Allergy.fromJson(Map json) { + patientID = json['PatientID']; + allergyDiseaseType = json['AllergyDiseaseType']; + allergyDiseaseID = json['AllergyDiseaseID']; + description = json['Description']; + descriptionN = json['DescriptionN']; + remarks = json['Remarks']; + avgDoctorRatingList = json['AvgDoctorRatingList']; + doctorRatingDetailsList = json['DoctorRatingDetailsList']; + notesDoctorRatingList = json['NotesDoctorRatingList']; + } + + Map toJson() { + final Map data = new Map(); + data['PatientID'] = this.patientID; + data['AllergyDiseaseType'] = this.allergyDiseaseType; + data['AllergyDiseaseID'] = this.allergyDiseaseID; + data['Description'] = this.description; + data['DescriptionN'] = this.descriptionN; + data['Remarks'] = this.remarks; + data['AvgDoctorRatingList'] = this.avgDoctorRatingList; + data['DoctorRatingDetailsList'] = this.doctorRatingDetailsList; + data['NotesDoctorRatingList'] = this.notesDoctorRatingList; + return data; + } +} diff --git a/lib/core/model/active_medications/ActivePrescriptionReport.dart b/lib/core/model/active_medications/ActivePrescriptionReport.dart new file mode 100644 index 00000000..866cb728 --- /dev/null +++ b/lib/core/model/active_medications/ActivePrescriptionReport.dart @@ -0,0 +1,146 @@ +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; + +class ActivePrescriptionReport { + dynamic address; + int appointmentNo; + dynamic clinic; + dynamic companyName; + int days; + dynamic doctorName; + int doseDailyQuantity; + String frequency; + int frequencyNumber; + List image; + String imageExtension; + dynamic imageSRCUrl; + String imageString; + dynamic imageThumbUrl; + dynamic isCovered; + String itemDescription; + int itemID; + DateTime orderDate; + int patientID; + dynamic patientName; + dynamic phoneOffice1; + dynamic prescriptionQR; + int prescriptionTimes; + dynamic productImage; + String productImageBase64; + String productImageString; + int projectID; + dynamic projectName; + dynamic remarks; + String route; + String sKU; + int scaleOffset; + DateTime startDate; + + ActivePrescriptionReport( + {this.address, + this.appointmentNo, + this.clinic, + this.companyName, + this.days, + this.doctorName, + this.doseDailyQuantity, + this.frequency, + this.frequencyNumber, + this.image, + this.imageExtension, + this.imageSRCUrl, + this.imageString, + this.imageThumbUrl, + this.isCovered, + this.itemDescription, + this.itemID, + this.orderDate, + this.patientID, + this.patientName, + this.phoneOffice1, + this.prescriptionQR, + this.prescriptionTimes, + this.productImage, + this.productImageBase64, + this.productImageString, + this.projectID, + this.projectName, + this.remarks, + this.route, + this.sKU, + this.scaleOffset, + this.startDate}); + + ActivePrescriptionReport.fromJson(Map json) { + address = json['Address']; + appointmentNo = json['AppointmentNo']; + clinic = json['Clinic']; + companyName = json['CompanyName']; + days = json['Days']; + doctorName = json['DoctorName']; + doseDailyQuantity = json['DoseDailyQuantity']; + frequency = json['Frequency']; + frequencyNumber = json['FrequencyNumber']; + image = json['Image'].cast(); + imageExtension = json['ImageExtension']; + imageSRCUrl = json['ImageSRCUrl']; + imageString = json['ImageString']; + imageThumbUrl = json['ImageThumbUrl']; + isCovered = json['IsCovered']; + itemDescription = json['ItemDescription']; + itemID = json['ItemID']; + orderDate = DateUtil.convertStringToDate(json['OrderDate']); + patientID = json['PatientID']; + patientName = json['PatientName']; + phoneOffice1 = json['PhoneOffice1']; + prescriptionQR = json['PrescriptionQR']; + prescriptionTimes = json['PrescriptionTimes']; + productImage = json['ProductImage']; + productImageBase64 = json['ProductImageBase64']; + productImageString = json['ProductImageString']; + projectID = json['ProjectID']; + projectName = json['ProjectName']; + remarks = json['Remarks']; + route = json['Route']; + sKU = json['SKU']; + scaleOffset = json['ScaleOffset']; + startDate = DateUtil.convertStringToDate(json['StartDate']); + } + + Map toJson() { + final Map data = new Map(); + data['Address'] = this.address; + data['AppointmentNo'] = this.appointmentNo; + data['Clinic'] = this.clinic; + data['CompanyName'] = this.companyName; + data['Days'] = this.days; + data['DoctorName'] = this.doctorName; + data['DoseDailyQuantity'] = this.doseDailyQuantity; + data['Frequency'] = this.frequency; + data['FrequencyNumber'] = this.frequencyNumber; + data['Image'] = this.image; + data['ImageExtension'] = this.imageExtension; + data['ImageSRCUrl'] = this.imageSRCUrl; + data['ImageString'] = this.imageString; + data['ImageThumbUrl'] = this.imageThumbUrl; + data['IsCovered'] = this.isCovered; + data['ItemDescription'] = this.itemDescription; + data['ItemID'] = this.itemID; + data['OrderDate'] = this.orderDate; + data['PatientID'] = this.patientID; + data['PatientName'] = this.patientName; + data['PhoneOffice1'] = this.phoneOffice1; + data['PrescriptionQR'] = this.prescriptionQR; + data['PrescriptionTimes'] = this.prescriptionTimes; + data['ProductImage'] = this.productImage; + data['ProductImageBase64'] = this.productImageBase64; + data['ProductImageString'] = this.productImageString; + data['ProjectID'] = this.projectID; + data['ProjectName'] = this.projectName; + data['Remarks'] = this.remarks; + data['Route'] = this.route; + data['SKU'] = this.sKU; + data['ScaleOffset'] = this.scaleOffset; + data['StartDate'] = this.startDate; + return data; + } +} diff --git a/lib/core/model/ask_doctor/AskDoctorReqTypes.dart b/lib/core/model/ask_doctor/AskDoctorReqTypes.dart new file mode 100644 index 00000000..b306f97b --- /dev/null +++ b/lib/core/model/ask_doctor/AskDoctorReqTypes.dart @@ -0,0 +1,92 @@ +class AskDoctorReqTypes { + dynamic setupID; + int parameterGroup; + int parameterType; + int parameterCode; + String description; + dynamic descriptionN; + dynamic alias; + dynamic aliasN; + dynamic prefix; + dynamic suffix; + dynamic isColorCodingRequired; + dynamic backColor; + dynamic foreColor; + bool isBuiltIn; + bool isActive; + int createdBy; + String createdOn; + dynamic editedBy; + dynamic editedOn; + dynamic rowVer; + + AskDoctorReqTypes( + {this.setupID, + this.parameterGroup, + this.parameterType, + this.parameterCode, + this.description, + this.descriptionN, + this.alias, + this.aliasN, + this.prefix, + this.suffix, + this.isColorCodingRequired, + this.backColor, + this.foreColor, + this.isBuiltIn, + this.isActive, + this.createdBy, + this.createdOn, + this.editedBy, + this.editedOn, + this.rowVer}); + + AskDoctorReqTypes.fromJson(Map json) { + setupID = json['SetupID']; + parameterGroup = json['ParameterGroup']; + parameterType = json['ParameterType']; + parameterCode = json['ParameterCode']; + description = json['Description']; + descriptionN = json['DescriptionN']; + alias = json['Alias']; + aliasN = json['AliasN']; + prefix = json['Prefix']; + suffix = json['Suffix']; + isColorCodingRequired = json['IsColorCodingRequired']; + backColor = json['BackColor']; + foreColor = json['ForeColor']; + isBuiltIn = json['IsBuiltIn']; + isActive = json['IsActive']; + createdBy = json['CreatedBy']; + createdOn = json['CreatedOn']; + editedBy = json['EditedBy']; + editedOn = json['EditedOn']; + rowVer = json['RowVer']; + } + + Map toJson() { + final Map data = new Map(); + data['SetupID'] = this.setupID; + data['ParameterGroup'] = this.parameterGroup; + data['ParameterType'] = this.parameterType; + data['ParameterCode'] = this.parameterCode; + data['Description'] = this.description; + data['DescriptionN'] = this.descriptionN; + data['Alias'] = this.alias; + data['AliasN'] = this.aliasN; + data['Prefix'] = this.prefix; + data['Suffix'] = this.suffix; + data['IsColorCodingRequired'] = this.isColorCodingRequired; + data['BackColor'] = this.backColor; + data['ForeColor'] = this.foreColor; + data['IsBuiltIn'] = this.isBuiltIn; + data['IsActive'] = this.isActive; + data['CreatedBy'] = this.createdBy; + data['CreatedOn'] = this.createdOn; + data['EditedBy'] = this.editedBy; + data['EditedOn'] = this.editedOn; + data['RowVer'] = this.rowVer; + return data; + } +} diff --git a/lib/core/model/ask_doctor/DoctorResponse.dart b/lib/core/model/ask_doctor/DoctorResponse.dart new file mode 100644 index 00000000..0dcd41b0 --- /dev/null +++ b/lib/core/model/ask_doctor/DoctorResponse.dart @@ -0,0 +1,76 @@ +class DoctorResponse { + int projectID; + int transactionNo; + int patientID; + int doctorID; + int requestType; + String requestTypeDescription; + dynamic requestTypeDescriptionN; + int status; + String remarks; + String createdOn; + dynamic readStatus; + String doctorName; + bool isDoctorRespond; + bool isPatientRead; + List transactions; + + DoctorResponse( + {this.projectID, + this.transactionNo, + this.patientID, + this.doctorID, + this.requestType, + this.requestTypeDescription, + this.requestTypeDescriptionN, + this.status, + this.remarks, + this.createdOn, + this.readStatus, + this.doctorName, + this.isDoctorRespond, + this.isPatientRead, + this.transactions}); + + DoctorResponse.fromJson(Map json) { + projectID = json['ProjectID']; + transactionNo = json['TransactionNo']; + patientID = json['PatientID']; + doctorID = json['DoctorID']; + requestType = json['RequestType']; + requestTypeDescription = json['RequestTypeDescription']; + requestTypeDescriptionN = json['RequestTypeDescriptionN']; + status = json['Status']; + remarks = json['Remarks']; + createdOn = json['CreatedOn']; + readStatus = json['ReadStatus']; + doctorName = json['DoctorName']; + isDoctorRespond = json['IsDoctorRespond']; + isPatientRead = json['IsPatientRead']; + if (json['Transactions'] != null) { + transactions = json['Transactions']; + } + } + + Map toJson() { + final Map data = new Map(); + data['ProjectID'] = this.projectID; + data['TransactionNo'] = this.transactionNo; + data['PatientID'] = this.patientID; + data['DoctorID'] = this.doctorID; + data['RequestType'] = this.requestType; + data['RequestTypeDescription'] = this.requestTypeDescription; + data['RequestTypeDescriptionN'] = this.requestTypeDescriptionN; + data['Status'] = this.status; + data['Remarks'] = this.remarks; + data['CreatedOn'] = this.createdOn; + data['ReadStatus'] = this.readStatus; + data['DoctorName'] = this.doctorName; + data['IsDoctorRespond'] = this.isDoctorRespond; + data['IsPatientRead'] = this.isPatientRead; + if (this.transactions != null) { + data['Transactions'] = this.transactions.map((v) => v.toJson()).toList(); + } + return data; + } +} diff --git a/lib/core/model/eye/AppoimentAllHistoryResult.dart b/lib/core/model/eye/AppoimentAllHistoryResult.dart new file mode 100644 index 00000000..ed123023 --- /dev/null +++ b/lib/core/model/eye/AppoimentAllHistoryResult.dart @@ -0,0 +1,497 @@ +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; + +class AppoimentAllHistoryResultList { + String setupID; + int projectID; + int appointmentNo; + String appointmentDate; + Null appointmentDateN; + int appointmentType; + DateTime bookDate; + dynamic patientType; + int patientID; + dynamic clinicID; + int doctorID; + String endDate; + String startTime; + String endTime; + dynamic status; + dynamic visitType; + int visitFor; + int patientStatusType; + int companyID; + int bookedBy; + String bookedOn; + int confirmedBy; + String confirmedOn; + int arrivalChangedBy; + String arrivedOn; + Null editedBy; + Null editedOn; + Null doctorName; + Null doctorNameN; + String statusDesc; + Null statusDescN; + bool vitalStatus; + Null vitalSignAppointmentNo; + int episodeID; + int actualDoctorRate; + String clinicName; + bool complainExists; + String doctorImageURL; + String doctorNameObj; + int doctorRate; + List doctorSpeciality; + String doctorTitle; + int gender; + String genderDescription; + bool iSAllowOnlineCheckedIN; + bool isActiveDoctor; + bool isActiveDoctorProfile; + bool isDoctorAllowVedioCall; + bool isExecludeDoctor; + int isFollowup; + bool isLiveCareAppointment; + bool isMedicalReportRequested; + bool isOnlineCheckedIN; + String latitude; + List listHISGetContactLensPerscription; + List listHISGetGlassPerscription; + String longitude; + int nextAction; + int noOfPatientsRate; + int originalClinicID; + int originalProjectID; + String projectName; + String qR; + int remaniningHoursTocanPay; + bool sMSButtonVisable; + + AppoimentAllHistoryResultList( + {this.setupID, + this.projectID, + this.appointmentNo, + this.appointmentDate, + this.appointmentDateN, + this.appointmentType, + this.bookDate, + this.patientID, + this.doctorID, + this.endDate, + this.startTime, + this.endTime, + this.status, + this.visitFor, + this.patientStatusType, + this.companyID, + this.bookedBy, + this.bookedOn, + this.confirmedBy, + this.confirmedOn, + this.arrivalChangedBy, + this.arrivedOn, + this.editedBy, + this.editedOn, + this.doctorName, + this.doctorNameN, + this.statusDesc, + this.statusDescN, + this.vitalStatus, + this.vitalSignAppointmentNo, + this.episodeID, + this.actualDoctorRate, + this.clinicName, + this.complainExists, + this.doctorImageURL, + this.doctorNameObj, + this.doctorRate, + this.doctorSpeciality, + this.doctorTitle, + this.gender, + this.genderDescription, + this.iSAllowOnlineCheckedIN, + this.isActiveDoctor, + this.isActiveDoctorProfile, + this.isDoctorAllowVedioCall, + this.isExecludeDoctor, + this.isFollowup, + this.isLiveCareAppointment, + this.isMedicalReportRequested, + this.isOnlineCheckedIN, + this.latitude, + this.listHISGetContactLensPerscription, + this.listHISGetGlassPerscription, + this.longitude, + this.nextAction, + this.noOfPatientsRate, + this.originalClinicID, + this.originalProjectID, + this.projectName, + this.qR, + this.remaniningHoursTocanPay, + this.sMSButtonVisable, + this.clinicID, + this.patientType, + + this.visitType}); + + AppoimentAllHistoryResultList.fromJson(Map json) { + setupID = json['SetupID']; + projectID = json['ProjectID']; + appointmentNo = json['AppointmentNo']; + appointmentDate = json['AppointmentDate']; + appointmentDateN = json['AppointmentDateN']; + appointmentType = json['AppointmentType']; + bookDate = DateUtil.convertStringToDate(json['BookDate']); + patientType = json['PatientType']; + patientID = json['PatientID']; + clinicID = json['ClinicID']; + doctorID = json['DoctorID']; + endDate = json['EndDate']; + startTime = json['StartTime']; + endTime = json['EndTime']; + status = json['Status']; + visitType = json['VisitType']; + visitFor = json['VisitFor']; + patientStatusType = json['PatientStatusType']; + companyID = json['CompanyID']; + bookedBy = json['BookedBy']; + bookedOn = json['BookedOn']; + confirmedBy = json['ConfirmedBy']; + confirmedOn = json['ConfirmedOn']; + arrivalChangedBy = json['ArrivalChangedBy']; + arrivedOn = json['ArrivedOn']; + editedBy = json['EditedBy']; + editedOn = json['EditedOn']; + doctorName = json['DoctorName']; + doctorNameN = json['DoctorNameN']; + statusDesc = json['StatusDesc']; + statusDescN = json['StatusDescN']; + vitalStatus = json['VitalStatus']; + vitalSignAppointmentNo = json['VitalSignAppointmentNo']; + episodeID = json['EpisodeID']; + actualDoctorRate = json['ActualDoctorRate']; + clinicName = json['ClinicName']; + complainExists = json['ComplainExists']; + doctorImageURL = json['DoctorImageURL']; + doctorNameObj = json['DoctorNameObj']; + doctorRate = json['DoctorRate']; + // doctorSpeciality = json['DoctorSpeciality'].cast(); + doctorTitle = json['DoctorTitle']; + gender = json['Gender']; + genderDescription = json['GenderDescription']; + iSAllowOnlineCheckedIN = json['ISAllowOnlineCheckedIN']; + isActiveDoctor = json['IsActiveDoctor']; + isActiveDoctorProfile = json['IsActiveDoctorProfile']; + isDoctorAllowVedioCall = json['IsDoctorAllowVedioCall']; + isExecludeDoctor = json['IsExecludeDoctor']; + isFollowup = json['IsFollowup']; + isLiveCareAppointment = json['IsLiveCareAppointment']; + isMedicalReportRequested = json['IsMedicalReportRequested']; + isOnlineCheckedIN = json['IsOnlineCheckedIN']; + latitude = json['Latitude']; + if (json['List_HIS_GetContactLensPerscription'] != null) { + listHISGetContactLensPerscription = + new List(); + json['List_HIS_GetContactLensPerscription'].forEach((v) { + listHISGetContactLensPerscription + .add(new ListHISGetContactLensPerscription.fromJson(v)); + }); + } + if (json['List_HIS_GetGlassPerscription'] != null) { + listHISGetGlassPerscription = new List(); + json['List_HIS_GetGlassPerscription'].forEach((v) { + listHISGetGlassPerscription + .add(new ListHISGetGlassPerscription.fromJson(v)); + }); + } + longitude = json['Longitude']; + nextAction = json['NextAction']; + noOfPatientsRate = json['NoOfPatientsRate']; + originalClinicID = json['OriginalClinicID']; + originalProjectID = json['OriginalProjectID']; + projectName = json['ProjectName']; + qR = json['QR']; + remaniningHoursTocanPay = json['RemaniningHoursTocanPay']; + sMSButtonVisable = json['SMSButtonVisable']; + clinicID = json['clinicID']; + patientType = json['patientType']; + status = json['status']; + visitType = json['visitType']; + } + + Map toJson() { + final Map data = new Map(); + data['SetupID'] = this.setupID; + data['ProjectID'] = this.projectID; + data['AppointmentNo'] = this.appointmentNo; + data['AppointmentDate'] = this.appointmentDate; + data['AppointmentDateN'] = this.appointmentDateN; + data['AppointmentType'] = this.appointmentType; + data['BookDate'] = this.bookDate; + data['PatientType'] = this.patientType; + data['PatientID'] = this.patientID; + data['ClinicID'] = this.clinicID; + data['DoctorID'] = this.doctorID; + data['EndDate'] = this.endDate; + data['StartTime'] = this.startTime; + data['EndTime'] = this.endTime; + data['Status'] = this.status; + data['VisitType'] = this.visitType; + data['VisitFor'] = this.visitFor; + data['PatientStatusType'] = this.patientStatusType; + data['CompanyID'] = this.companyID; + data['BookedBy'] = this.bookedBy; + data['BookedOn'] = this.bookedOn; + data['ConfirmedBy'] = this.confirmedBy; + data['ConfirmedOn'] = this.confirmedOn; + data['ArrivalChangedBy'] = this.arrivalChangedBy; + data['ArrivedOn'] = this.arrivedOn; + data['EditedBy'] = this.editedBy; + data['EditedOn'] = this.editedOn; + data['DoctorName'] = this.doctorName; + data['DoctorNameN'] = this.doctorNameN; + data['StatusDesc'] = this.statusDesc; + data['StatusDescN'] = this.statusDescN; + data['VitalStatus'] = this.vitalStatus; + data['VitalSignAppointmentNo'] = this.vitalSignAppointmentNo; + data['EpisodeID'] = this.episodeID; + data['ActualDoctorRate'] = this.actualDoctorRate; + data['ClinicName'] = this.clinicName; + data['ComplainExists'] = this.complainExists; + data['DoctorImageURL'] = this.doctorImageURL; + data['DoctorNameObj'] = this.doctorNameObj; + data['DoctorRate'] = this.doctorRate; + data['DoctorSpeciality'] = this.doctorSpeciality; + data['DoctorTitle'] = this.doctorTitle; + data['Gender'] = this.gender; + data['GenderDescription'] = this.genderDescription; + data['ISAllowOnlineCheckedIN'] = this.iSAllowOnlineCheckedIN; + data['IsActiveDoctor'] = this.isActiveDoctor; + data['IsActiveDoctorProfile'] = this.isActiveDoctorProfile; + data['IsDoctorAllowVedioCall'] = this.isDoctorAllowVedioCall; + data['IsExecludeDoctor'] = this.isExecludeDoctor; + data['IsFollowup'] = this.isFollowup; + data['IsLiveCareAppointment'] = this.isLiveCareAppointment; + data['IsMedicalReportRequested'] = this.isMedicalReportRequested; + data['IsOnlineCheckedIN'] = this.isOnlineCheckedIN; + data['Latitude'] = this.latitude; + if (this.listHISGetContactLensPerscription != null) { + data['List_HIS_GetContactLensPerscription'] = this + .listHISGetContactLensPerscription + .map((v) => v.toJson()) + .toList(); + } + if (this.listHISGetGlassPerscription != null) { + data['List_HIS_GetGlassPerscription'] = + this.listHISGetGlassPerscription.map((v) => v.toJson()).toList(); + } + data['Longitude'] = this.longitude; + data['NextAction'] = this.nextAction; + data['NoOfPatientsRate'] = this.noOfPatientsRate; + data['OriginalClinicID'] = this.originalClinicID; + data['OriginalProjectID'] = this.originalProjectID; + data['ProjectName'] = this.projectName; + data['QR'] = this.qR; + data['RemaniningHoursTocanPay'] = this.remaniningHoursTocanPay; + data['SMSButtonVisable'] = this.sMSButtonVisable; + data['clinicID'] = this.clinicID; + data['patientType'] = this.patientType; + data['status'] = this.status; + data['visitType'] = this.visitType; + return data; + } +} + +class ListHISGetContactLensPerscription { + String setupId; + int projectId; + int patientType; + int patientId; + int encounterType; + int encounterNo; + int oDOS; + dynamic brand; + dynamic baseCurve; + dynamic power; + dynamic diameter; + dynamic oZ; + dynamic cT; + dynamic blend; + String remarks; + int status; + bool isActive; + String createdOn; + + ListHISGetContactLensPerscription( + {this.setupId, + this.projectId, + this.patientType, + this.patientId, + this.encounterType, + this.encounterNo, + this.oDOS, + this.brand, + this.baseCurve, + this.power, + this.diameter, + this.oZ, + this.cT, + this.blend, + this.remarks, + this.status, + this.isActive, + this.createdOn}); + + ListHISGetContactLensPerscription.fromJson(Map json) { + setupId = json['SetupId']; + projectId = json['ProjectId']; + patientType = json['PatientType']; + patientId = json['PatientId']; + encounterType = json['EncounterType']; + encounterNo = json['EncounterNo']; + oDOS = json['OD_OS']; + brand = json['Brand']; + baseCurve = json['BaseCurve']; + power = json['Power']; + diameter = json['Diameter']; + oZ = json['OZ']; + cT = json['CT']; + blend = json['Blend']; + remarks = json['Remarks']; + status = json['Status']; + isActive = json['IsActive']; + createdOn = json['CreatedOn']; + } + + Map toJson() { + final Map data = new Map(); + data['SetupId'] = this.setupId; + data['ProjectId'] = this.projectId; + data['PatientType'] = this.patientType; + data['PatientId'] = this.patientId; + data['EncounterType'] = this.encounterType; + data['EncounterNo'] = this.encounterNo; + data['OD_OS'] = this.oDOS; + data['Brand'] = this.brand; + data['BaseCurve'] = this.baseCurve; + data['Power'] = this.power; + data['Diameter'] = this.diameter; + data['OZ'] = this.oZ; + data['CT'] = this.cT; + data['Blend'] = this.blend; + data['Remarks'] = this.remarks; + data['Status'] = this.status; + data['IsActive'] = this.isActive; + data['CreatedOn'] = this.createdOn; + return data; + } +} + +class ListHISGetGlassPerscription { + dynamic projectID; + String setupID; + dynamic patientId; + dynamic encounterType; + dynamic encounterNo; + String visionType; + double rightEyeSpherical; + dynamic rightEyeCylinder; + dynamic rightEyeAxis; + dynamic rightEyePrism; + dynamic rightEyeVA; + String rightEyeRemarks; + dynamic leftEyeSpherical; + dynamic leftEyeCylinder; + dynamic leftEyeAxis; + dynamic leftEyePrism; + dynamic leftEyeVA; + String leftEyeRemarks; + dynamic pD; + dynamic bVD; + dynamic status; + bool isActive; + String createdOn; + + ListHISGetGlassPerscription( + {this.projectID, + this.setupID, + this.patientId, + this.encounterType, + this.encounterNo, + this.visionType, + this.rightEyeSpherical, + this.rightEyeCylinder, + this.rightEyeAxis, + this.rightEyePrism, + this.rightEyeVA, + this.rightEyeRemarks, + this.leftEyeSpherical, + this.leftEyeCylinder, + this.leftEyeAxis, + this.leftEyePrism, + this.leftEyeVA, + this.leftEyeRemarks, + this.pD, + this.bVD, + this.status, + this.isActive, + this.createdOn}); + + ListHISGetGlassPerscription.fromJson(Map json) { + projectID = json['ProjectID']; + setupID = json['SetupID']; + patientId = json['PatientId']; + encounterType = json['EncounterType']; + encounterNo = json['EncounterNo']; + visionType = json['VisionType']; + rightEyeSpherical = json['RightEyeSpherical']; + rightEyeCylinder = json['RightEyeCylinder']; + rightEyeAxis = json['RightEyeAxis']; + rightEyePrism = json['RightEyePrism']; + rightEyeVA = json['RightEyeVA']; + rightEyeRemarks = json['RightEyeRemarks']; + leftEyeSpherical = json['LeftEyeSpherical']; + leftEyeCylinder = json['LeftEyeCylinder']; + leftEyeAxis = json['LeftEyeAxis']; + leftEyePrism = json['LeftEyePrism']; + leftEyeVA = json['LeftEyeVA']; + leftEyeRemarks = json['LeftEyeRemarks']; + pD = json['PD']; + bVD = json['BVD']; + status = json['Status']; + isActive = json['IsActive']; + createdOn = json['CreatedOn']; + } + + Map toJson() { + final Map data = new Map(); + data['ProjectID'] = this.projectID; + data['SetupID'] = this.setupID; + data['PatientId'] = this.patientId; + data['EncounterType'] = this.encounterType; + data['EncounterNo'] = this.encounterNo; + data['VisionType'] = this.visionType; + data['RightEyeSpherical'] = this.rightEyeSpherical; + data['RightEyeCylinder'] = this.rightEyeCylinder; + data['RightEyeAxis'] = this.rightEyeAxis; + data['RightEyePrism'] = this.rightEyePrism; + data['RightEyeVA'] = this.rightEyeVA; + data['RightEyeRemarks'] = this.rightEyeRemarks; + data['LeftEyeSpherical'] = this.leftEyeSpherical; + data['LeftEyeCylinder'] = this.leftEyeCylinder; + data['LeftEyeAxis'] = this.leftEyeAxis; + data['LeftEyePrism'] = this.leftEyePrism; + data['LeftEyeVA'] = this.leftEyeVA; + data['LeftEyeRemarks'] = this.leftEyeRemarks; + data['PD'] = this.pD; + data['BVD'] = this.bVD; + data['Status'] = this.status; + data['IsActive'] = this.isActive; + data['CreatedOn'] = this.createdOn; + return data; + } +} + + + diff --git a/lib/core/model/eye/AppointmentFilter.dart b/lib/core/model/eye/AppointmentFilter.dart new file mode 100644 index 00000000..1f4b0ae5 --- /dev/null +++ b/lib/core/model/eye/AppointmentFilter.dart @@ -0,0 +1,12 @@ +import 'AppoimentAllHistoryResult.dart'; + +class AppointmentFilter { + List appointmentAllHistoryResultList = List(); + String filterName; + + AppointmentFilter( + AppoimentAllHistoryResultList allHistoryResultList, String filterName) { + appointmentAllHistoryResultList.add(allHistoryResultList); + this.filterName = filterName; + } +} diff --git a/lib/core/model/my_trakers/blood_pressur/BloodPressureResult.dart b/lib/core/model/my_trakers/blood_pressur/BloodPressureResult.dart new file mode 100644 index 00000000..57f2cd54 --- /dev/null +++ b/lib/core/model/my_trakers/blood_pressur/BloodPressureResult.dart @@ -0,0 +1,90 @@ +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; + +class BloodPressureResult { + int patientID; + int lineItemNo; + DateTime bloodPressureDate; + int measuredArm; + int systolicePressure; + int diastolicPressure; + dynamic remark; + bool isActive; + int chartYear; + String chartMonth; + dynamic yearSystolicePressureAverageResult; + dynamic monthSystolicePressureResult; + dynamic weekSystolicePressureResult; + int yearDiastolicPressureAverageResult; + dynamic monthDiastolicPressureResult; + dynamic weekDiastolicPressureResult; + String measuredArmDesc; + dynamic weekDesc; + + BloodPressureResult( + {this.patientID, + this.lineItemNo, + this.bloodPressureDate, + this.measuredArm, + this.systolicePressure, + this.diastolicPressure, + this.remark, + this.isActive, + this.chartYear, + this.chartMonth, + this.yearSystolicePressureAverageResult, + this.monthSystolicePressureResult, + this.weekSystolicePressureResult, + this.yearDiastolicPressureAverageResult, + this.monthDiastolicPressureResult, + this.weekDiastolicPressureResult, + this.measuredArmDesc, + this.weekDesc}); + + BloodPressureResult.fromJson(Map json) { + patientID = json['PatientID']; + lineItemNo = json['LineItemNo']; + bloodPressureDate =DateUtil.convertStringToDate(json['BloodPressureDate']); + measuredArm = json['MeasuredArm']; + systolicePressure = json['SystolicePressure']; + diastolicPressure = json['DiastolicPressure']; + remark = json['Remark']; + isActive = json['IsActive']; + chartYear = json['ChartYear']; + chartMonth = json['ChartMonth']; + yearSystolicePressureAverageResult = + json['YearSystolicePressureAverageResult']; + monthSystolicePressureResult = json['MonthSystolicePressureResult']; + weekSystolicePressureResult = json['WeekSystolicePressureResult']; + yearDiastolicPressureAverageResult = + json['YearDiastolicPressureAverageResult']; + monthDiastolicPressureResult = json['MonthDiastolicPressureResult']; + weekDiastolicPressureResult = json['WeekDiastolicPressureResult']; + measuredArmDesc = json['MeasuredArmDesc']; + weekDesc = json['WeekDesc']; + } + + Map toJson() { + final Map data = new Map(); + data['PatientID'] = this.patientID; + data['LineItemNo'] = this.lineItemNo; + data['BloodPressureDate'] = this.bloodPressureDate; + data['MeasuredArm'] = this.measuredArm; + data['SystolicePressure'] = this.systolicePressure; + data['DiastolicPressure'] = this.diastolicPressure; + data['Remark'] = this.remark; + data['IsActive'] = this.isActive; + data['ChartYear'] = this.chartYear; + data['ChartMonth'] = this.chartMonth; + data['YearSystolicePressureAverageResult'] = + this.yearSystolicePressureAverageResult; + data['MonthSystolicePressureResult'] = this.monthSystolicePressureResult; + data['WeekSystolicePressureResult'] = this.weekSystolicePressureResult; + data['YearDiastolicPressureAverageResult'] = + this.yearDiastolicPressureAverageResult; + data['MonthDiastolicPressureResult'] = this.monthDiastolicPressureResult; + data['WeekDiastolicPressureResult'] = this.weekDiastolicPressureResult; + data['MeasuredArmDesc'] = this.measuredArmDesc; + data['WeekDesc'] = this.weekDesc; + return data; + } +} diff --git a/lib/core/model/my_trakers/blood_pressur/MonthBloodPressureResultAverage.dart b/lib/core/model/my_trakers/blood_pressur/MonthBloodPressureResultAverage.dart new file mode 100644 index 00000000..5343119c --- /dev/null +++ b/lib/core/model/my_trakers/blood_pressur/MonthBloodPressureResultAverage.dart @@ -0,0 +1,76 @@ +class MonthBloodPressureResultAverage { + dynamic weekfourSystolicePressureAverageResult; + dynamic weekfourDiastolicPressureAverageResult; + dynamic weekthreeSystolicePressureAverageResult; + dynamic weekthreeDiastolicPressureAverageResult; + dynamic weektwoSystolicePressureAverageResult; + dynamic weektwoDiastolicPressureAverageResult; + dynamic weekoneSystolicePressureAverageResult; + dynamic weekoneDiastolicPressureAverageResult; + String weekDesc; + int weekDiastolicPressureAverageResult; + int weekSystolicePressureAverageResult; + + MonthBloodPressureResultAverage( + {this.weekfourSystolicePressureAverageResult, + this.weekfourDiastolicPressureAverageResult, + this.weekthreeSystolicePressureAverageResult, + this.weekthreeDiastolicPressureAverageResult, + this.weektwoSystolicePressureAverageResult, + this.weektwoDiastolicPressureAverageResult, + this.weekoneSystolicePressureAverageResult, + this.weekoneDiastolicPressureAverageResult, + this.weekDesc, + this.weekDiastolicPressureAverageResult, + this.weekSystolicePressureAverageResult}); + + MonthBloodPressureResultAverage.fromJson(Map json) { + weekfourSystolicePressureAverageResult = + json['weekfourSystolicePressureAverageResult']; + weekfourDiastolicPressureAverageResult = + json['weekfourDiastolicPressureAverageResult']; + weekthreeSystolicePressureAverageResult = + json['weekthreeSystolicePressureAverageResult']; + weekthreeDiastolicPressureAverageResult = + json['weekthreeDiastolicPressureAverageResult']; + weektwoSystolicePressureAverageResult = + json['weektwoSystolicePressureAverageResult']; + weektwoDiastolicPressureAverageResult = + json['weektwoDiastolicPressureAverageResult']; + weekoneSystolicePressureAverageResult = + json['weekoneSystolicePressureAverageResult']; + weekoneDiastolicPressureAverageResult = + json['weekoneDiastolicPressureAverageResult']; + weekDesc = json['WeekDesc']; + weekDiastolicPressureAverageResult = + json['WeekDiastolicPressureAverageResult']; + weekSystolicePressureAverageResult = + json['WeekSystolicePressureAverageResult']; + } + + Map toJson() { + final Map data = new Map(); + data['weekfourSystolicePressureAverageResult'] = + this.weekfourSystolicePressureAverageResult; + data['weekfourDiastolicPressureAverageResult'] = + this.weekfourDiastolicPressureAverageResult; + data['weekthreeSystolicePressureAverageResult'] = + this.weekthreeSystolicePressureAverageResult; + data['weekthreeDiastolicPressureAverageResult'] = + this.weekthreeDiastolicPressureAverageResult; + data['weektwoSystolicePressureAverageResult'] = + this.weektwoSystolicePressureAverageResult; + data['weektwoDiastolicPressureAverageResult'] = + this.weektwoDiastolicPressureAverageResult; + data['weekoneSystolicePressureAverageResult'] = + this.weekoneSystolicePressureAverageResult; + data['weekoneDiastolicPressureAverageResult'] = + this.weekoneDiastolicPressureAverageResult; + data['WeekDesc'] = this.weekDesc; + data['WeekDiastolicPressureAverageResult'] = + this.weekDiastolicPressureAverageResult; + data['WeekSystolicePressureAverageResult'] = + this.weekSystolicePressureAverageResult; + return data; + } +} diff --git a/lib/core/model/my_trakers/blood_pressur/WeekBloodPressureResultAverage.dart b/lib/core/model/my_trakers/blood_pressur/WeekBloodPressureResultAverage.dart new file mode 100644 index 00000000..b7f3fc80 --- /dev/null +++ b/lib/core/model/my_trakers/blood_pressur/WeekBloodPressureResultAverage.dart @@ -0,0 +1,30 @@ +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; + +class WeekBloodPressureResultAverage { + int dailySystolicePressureAverageResult; + int dailyDiastolicPressureAverageResult; + DateTime bloodPressureDate; + + WeekBloodPressureResultAverage( + {this.dailySystolicePressureAverageResult, + this.dailyDiastolicPressureAverageResult, + this.bloodPressureDate}); + + WeekBloodPressureResultAverage.fromJson(Map json) { + dailySystolicePressureAverageResult = + json['DailySystolicePressureAverageResult']; + dailyDiastolicPressureAverageResult = + json['DailyDiastolicPressureAverageResult']; + bloodPressureDate = DateUtil.convertStringToDate(json['BloodPressureDate']); + } + + Map toJson() { + final Map data = new Map(); + data['DailySystolicePressureAverageResult'] = + this.dailySystolicePressureAverageResult; + data['DailyDiastolicPressureAverageResult'] = + this.dailyDiastolicPressureAverageResult; + data['BloodPressureDate'] = this.bloodPressureDate; + return data; + } +} diff --git a/lib/core/model/my_trakers/blood_pressur/YearBloodPressureResultAverage.dart b/lib/core/model/my_trakers/blood_pressur/YearBloodPressureResultAverage.dart new file mode 100644 index 00000000..095738d6 --- /dev/null +++ b/lib/core/model/my_trakers/blood_pressur/YearBloodPressureResultAverage.dart @@ -0,0 +1,41 @@ +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; + +class YearBloodPressureResultAverage { + int monthSystolicePressureAverageResult; + int monthDiastolicPressureAverageResult; + dynamic monthNumber; + String monthName; + String yearName; + DateTime date; + + YearBloodPressureResultAverage( + {this.monthSystolicePressureAverageResult, + this.monthDiastolicPressureAverageResult, + this.monthNumber, + this.monthName, + this.yearName}); + + YearBloodPressureResultAverage.fromJson(Map json) { + monthSystolicePressureAverageResult = + json['monthSystolicePressureAverageResult']; + monthDiastolicPressureAverageResult = + json['monthDiastolicPressureAverageResult']; + monthNumber = json['monthNumber']; + monthName = json['monthName']; + yearName = json['yearName']; + date = DateUtil.getMonthDateTime(monthName,yearName); + + } + + Map toJson() { + final Map data = new Map(); + data['monthSystolicePressureAverageResult'] = + this.monthSystolicePressureAverageResult; + data['monthDiastolicPressureAverageResult'] = + this.monthDiastolicPressureAverageResult; + data['monthNumber'] = this.monthNumber; + data['monthName'] = this.monthName; + data['yearName'] = this.yearName; + return data; + } +} diff --git a/lib/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart b/lib/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart new file mode 100644 index 00000000..5b95409e --- /dev/null +++ b/lib/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart @@ -0,0 +1,98 @@ +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; + +class DiabtecPatientResult { + String chartMonth; + var chartYear; + DateTime dateChart; + var description; + var descriptionN; + int diabtecAvarage; + bool isActive; + int lineItemNo; + var listMonth; + var listWeek; + int measured; + String measuredDesc; + var monthAverageResult; + int patientID; + var remark; + var resultDesc; + int resultValue; + String unit; + var weekAverageResult; + String weekDesc; + var yearAverageResult; + + DiabtecPatientResult( + {this.chartMonth, + this.chartYear, + this.dateChart, + this.description, + this.descriptionN, + this.diabtecAvarage, + this.isActive, + this.lineItemNo, + this.listMonth, + this.listWeek, + this.measured, + this.measuredDesc, + this.monthAverageResult, + this.patientID, + this.remark, + this.resultDesc, + this.resultValue, + this.unit, + this.weekAverageResult, + this.weekDesc, + this.yearAverageResult}); + + DiabtecPatientResult.fromJson(Map json) { + chartMonth = json['ChartMonth']; + chartYear = json['ChartYear']; + dateChart = DateUtil.convertStringToDate(json['DateChart']); + description = json['Description']; + descriptionN = json['DescriptionN']; + diabtecAvarage = json['DiabtecAvarage']; + isActive = json['IsActive']; + lineItemNo = json['LineItemNo']; + listMonth = json['List_Month']; + listWeek = json['List_Week']; + measured = json['Measured']; + measuredDesc = json['MeasuredDesc']; + monthAverageResult = json['MonthAverageResult']; + patientID = json['PatientID']; + remark = json['Remark']; + resultDesc = json['ResultDesc']; + resultValue = json['ResultValue']; + unit = json['Unit']; + weekAverageResult = json['WeekAverageResult']; + weekDesc = json['WeekDesc']; + yearAverageResult = json['YearAverageResult']; + } + + Map toJson() { + final Map data = new Map(); + data['ChartMonth'] = this.chartMonth; + data['ChartYear'] = this.chartYear; + data['DateChart'] = DateUtil.convertDateToString(this.dateChart); + data['Description'] = this.description; + data['DescriptionN'] = this.descriptionN; + data['DiabtecAvarage'] = this.diabtecAvarage; + data['IsActive'] = this.isActive; + data['LineItemNo'] = this.lineItemNo; + data['List_Month'] = this.listMonth; + data['List_Week'] = this.listWeek; + data['Measured'] = this.measured; + data['MeasuredDesc'] = this.measuredDesc; + data['MonthAverageResult'] = this.monthAverageResult; + data['PatientID'] = this.patientID; + data['Remark'] = this.remark; + data['ResultDesc'] = this.resultDesc; + data['ResultValue'] = this.resultValue; + data['Unit'] = this.unit; + data['WeekAverageResult'] = this.weekAverageResult; + data['WeekDesc'] = this.weekDesc; + data['YearAverageResult'] = this.yearAverageResult; + return data; + } +} diff --git a/lib/core/model/my_trakers/blood_sugar/MonthDiabtectResultAverage.dart b/lib/core/model/my_trakers/blood_sugar/MonthDiabtectResultAverage.dart new file mode 100644 index 00000000..65522098 --- /dev/null +++ b/lib/core/model/my_trakers/blood_sugar/MonthDiabtectResultAverage.dart @@ -0,0 +1,36 @@ +class MonthDiabtectResultAverage { + var weekfourAverageResult; + var weekthreeAverageResult; + var weektwoAverageResult; + var weekoneAverageResult; + dynamic weekAverageResult; + String weekDesc; + + MonthDiabtectResultAverage( + {this.weekfourAverageResult, + this.weekthreeAverageResult, + this.weektwoAverageResult, + this.weekoneAverageResult, + this.weekAverageResult, + this.weekDesc}); + + MonthDiabtectResultAverage.fromJson(Map json) { + weekfourAverageResult = json['weekfourAverageResult']; + weekthreeAverageResult = json['weekthreeAverageResult']; + weektwoAverageResult = json['weektwoAverageResult']; + weekoneAverageResult = json['weekoneAverageResult']; + weekAverageResult = json['WeekAverageResult']; + weekDesc = json['WeekDesc']; + } + + Map toJson() { + final Map data = new Map(); + data['weekfourAverageResult'] = this.weekfourAverageResult; + data['weekthreeAverageResult'] = this.weekthreeAverageResult; + data['weektwoAverageResult'] = this.weektwoAverageResult; + data['weekoneAverageResult'] = this.weekoneAverageResult; + data['WeekAverageResult'] = this.weekAverageResult; + data['WeekDesc'] = this.weekDesc; + return data; + } +} diff --git a/lib/core/model/my_trakers/blood_sugar/WeekDiabtectResultAverage.dart b/lib/core/model/my_trakers/blood_sugar/WeekDiabtectResultAverage.dart new file mode 100644 index 00000000..c18e5433 --- /dev/null +++ b/lib/core/model/my_trakers/blood_sugar/WeekDiabtectResultAverage.dart @@ -0,0 +1,20 @@ +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; + +class WeekDiabtectResultAverage { + int dailyAverageResult; + DateTime dateChart; + + WeekDiabtectResultAverage({this.dailyAverageResult, this.dateChart}); + + WeekDiabtectResultAverage.fromJson(Map json) { + dailyAverageResult = json['DailyAverageResult']; + dateChart = DateUtil.convertStringToDate(json['DateChart']); + } + + Map toJson() { + final Map data = new Map(); + data['DailyAverageResult'] = this.dailyAverageResult; + data['DateChart'] = DateUtil.convertDateToString(this.dateChart); + return data; + } +} diff --git a/lib/core/model/my_trakers/blood_sugar/YearDiabtecResultAverage.dart b/lib/core/model/my_trakers/blood_sugar/YearDiabtecResultAverage.dart new file mode 100644 index 00000000..cfdec286 --- /dev/null +++ b/lib/core/model/my_trakers/blood_sugar/YearDiabtecResultAverage.dart @@ -0,0 +1,36 @@ +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; + +class YearDiabtecResultAverage { + dynamic monthAverageResult; + var monthNumber; + String monthName; + String yearName; + DateTime date; + + YearDiabtecResultAverage( + {this.monthAverageResult, + this.monthNumber, + this.monthName, + this.yearName}); + + YearDiabtecResultAverage.fromJson(Map json) { + try { + monthAverageResult = json['monthAverageResult']; + monthNumber = json['monthNumber']; + monthName = json['monthName']; + yearName = json['yearName']; + date = DateUtil.getMonthDateTime(monthName,yearName); + } catch (e) { + print(e); + } + } + + Map toJson() { + final Map data = new Map(); + data['monthAverageResult'] = this.monthAverageResult; + data['monthNumber'] = this.monthNumber; + data['monthName'] = this.monthName; + data['yearName'] = this.yearName; + return data; + } +} diff --git a/lib/core/model/my_trakers/chartData/WeekChartDate.dart b/lib/core/model/my_trakers/chartData/WeekChartDate.dart new file mode 100644 index 00000000..d972265d --- /dev/null +++ b/lib/core/model/my_trakers/chartData/WeekChartDate.dart @@ -0,0 +1,6 @@ +class WeekChartDate { + final DateTime x; + final dynamic y; + + WeekChartDate({this.x, this.y}); +} \ No newline at end of file diff --git a/lib/core/model/my_trakers/chartData/YearMonthlyChartDate.dart b/lib/core/model/my_trakers/chartData/YearMonthlyChartDate.dart new file mode 100644 index 00000000..96adca21 --- /dev/null +++ b/lib/core/model/my_trakers/chartData/YearMonthlyChartDate.dart @@ -0,0 +1,6 @@ + class YearMonthlyChartDate { + final dynamic x; + final dynamic y; + + YearMonthlyChartDate({this.x, this.y}); +} diff --git a/lib/core/model/my_trakers/weight/MonthWeightMeasurementResultAverage.dart b/lib/core/model/my_trakers/weight/MonthWeightMeasurementResultAverage.dart new file mode 100644 index 00000000..8165302d --- /dev/null +++ b/lib/core/model/my_trakers/weight/MonthWeightMeasurementResultAverage.dart @@ -0,0 +1,36 @@ +class MonthWeightMeasurementResultAverage { + dynamic weekfourAverageResult; + dynamic weekthreeAverageResult; + dynamic weektwoAverageResult; + dynamic weekoneAverageResult; + dynamic weekAverageResult; + String weekDesc; + + MonthWeightMeasurementResultAverage( + {this.weekfourAverageResult, + this.weekthreeAverageResult, + this.weektwoAverageResult, + this.weekoneAverageResult, + this.weekAverageResult, + this.weekDesc}); + + MonthWeightMeasurementResultAverage.fromJson(Map json) { + weekfourAverageResult = json['weekfourAverageResult']; + weekthreeAverageResult = json['weekthreeAverageResult']; + weektwoAverageResult = json['weektwoAverageResult']; + weekoneAverageResult = json['weekoneAverageResult']; + weekAverageResult = json['WeekAverageResult']; + weekDesc = json['WeekDesc']; + } + + Map toJson() { + final Map data = new Map(); + data['weekfourAverageResult'] = this.weekfourAverageResult; + data['weekthreeAverageResult'] = this.weekthreeAverageResult; + data['weektwoAverageResult'] = this.weektwoAverageResult; + data['weekoneAverageResult'] = this.weekoneAverageResult; + data['WeekAverageResult'] = this.weekAverageResult; + data['WeekDesc'] = this.weekDesc; + return data; + } +} diff --git a/lib/core/model/my_trakers/weight/WeekWeightMeasurementResultAverage.dart b/lib/core/model/my_trakers/weight/WeekWeightMeasurementResultAverage.dart new file mode 100644 index 00000000..b7345ad7 --- /dev/null +++ b/lib/core/model/my_trakers/weight/WeekWeightMeasurementResultAverage.dart @@ -0,0 +1,21 @@ +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; + +class WeekWeightMeasurementResultAverage { + dynamic dailyAverageResult; + DateTime weightDate; + + WeekWeightMeasurementResultAverage( + {this.dailyAverageResult, this.weightDate}); + + WeekWeightMeasurementResultAverage.fromJson(Map json) { + dailyAverageResult = json['DailyAverageResult']; + weightDate = DateUtil.convertStringToDate(json['WeightDate']); + } + + Map toJson() { + final Map data = new Map(); + data['DailyAverageResult'] = this.dailyAverageResult; + data['WeightDate'] = this.weightDate; + return data; + } +} diff --git a/lib/core/model/my_trakers/weight/WeightMeasurementResult.dart b/lib/core/model/my_trakers/weight/WeightMeasurementResult.dart new file mode 100644 index 00000000..337e8662 --- /dev/null +++ b/lib/core/model/my_trakers/weight/WeightMeasurementResult.dart @@ -0,0 +1,74 @@ +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; + +class WeightMeasurementResult { + int patientID; + int lineItemNo; + int weightMeasured; + DateTime weightDate; + dynamic remark; + bool isActive; + int measured; + dynamic unit; + int chartYear; + dynamic chartMonth; + double yearAverageResult; + dynamic monthAverageResult; + dynamic weekAverageResult; + dynamic weekDesc; + + WeightMeasurementResult( + {this.patientID, + this.lineItemNo, + this.weightMeasured, + this.weightDate, + this.remark, + this.isActive, + this.measured, + this.unit, + this.chartYear, + this.chartMonth, + this.yearAverageResult, + this.monthAverageResult, + this.weekAverageResult, + this.weekDesc}); + + WeightMeasurementResult.fromJson(Map json) { + try { + patientID = json['PatientID']; + lineItemNo = json['LineItemNo']; + weightMeasured = json['WeightMeasured']; + weightDate = DateUtil.convertStringToDate(json['WeightDate']); + remark = json['Remark']; + isActive = json['IsActive']; + measured = json['Measured']; + unit = json['Unit']; + chartYear = json['ChartYear']; + chartMonth = json['ChartMonth']; + yearAverageResult = json['YearAverageResult']; + monthAverageResult = json['MonthAverageResult']; + weekAverageResult = json['WeekAverageResult']; + weekDesc = json['WeekDesc']; + } catch (e) { + print(e); + } + } + + Map toJson() { + final Map data = new Map(); + data['PatientID'] = this.patientID; + data['LineItemNo'] = this.lineItemNo; + data['WeightMeasured'] = this.weightMeasured; + data['WeightDate'] = this.weightDate; + data['Remark'] = this.remark; + data['IsActive'] = this.isActive; + data['Measured'] = this.measured; + data['Unit'] = this.unit; + data['ChartYear'] = this.chartYear; + data['ChartMonth'] = this.chartMonth; + data['YearAverageResult'] = this.yearAverageResult; + data['MonthAverageResult'] = this.monthAverageResult; + data['WeekAverageResult'] = this.weekAverageResult; + data['WeekDesc'] = this.weekDesc; + return data; + } +} diff --git a/lib/core/model/my_trakers/weight/YearWeightMeasurementResultAverage.dart b/lib/core/model/my_trakers/weight/YearWeightMeasurementResultAverage.dart new file mode 100644 index 00000000..c2e20cb9 --- /dev/null +++ b/lib/core/model/my_trakers/weight/YearWeightMeasurementResultAverage.dart @@ -0,0 +1,33 @@ +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; + +class YearWeightMeasurementResultAverage { + dynamic monthAverageResult; + int monthNumber; + String monthName; + String yearName; + DateTime date; + + YearWeightMeasurementResultAverage( + {this.monthAverageResult, + this.monthNumber, + this.monthName, + this.yearName}); + + YearWeightMeasurementResultAverage.fromJson(Map json) { + monthAverageResult = json['monthAverageResult']; + monthNumber = json['monthNumber']; + monthName = json['monthName']; + yearName = json['yearName']; + date = DateUtil.getMonthDateTime(monthName,yearName); + + } + + Map toJson() { + final Map data = new Map(); + data['monthAverageResult'] = this.monthAverageResult; + data['monthNumber'] = this.monthNumber; + data['monthName'] = this.monthName; + data['yearName'] = this.yearName; + return data; + } +} diff --git a/lib/core/model/prescriptions/prescriptions_order.dart b/lib/core/model/prescriptions/prescriptions_order.dart index db2b1855..fdcbf203 100644 --- a/lib/core/model/prescriptions/prescriptions_order.dart +++ b/lib/core/model/prescriptions/prescriptions_order.dart @@ -2,35 +2,35 @@ import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; class PrescriptionsOrder { int iD; - String patientID; + dynamic patientID; bool patientOutSA; bool isOutPatient; int projectID; int nearestProjectID; double longitude; double latitude; - String appointmentNo; - String dischargeID; + dynamic appointmentNo; + dynamic dischargeID; int lineItemNo; int status; - String description; - String descriptionN; + dynamic description; + dynamic descriptionN; DateTime createdOn; int serviceID; int createdBy; DateTime editedOn; int editedBy; int channel; - String clientRequestID; + dynamic clientRequestID; bool returnedToQueue; - Null pickupDateTime; - Null pickupLocationName; - Null dropoffLocationName; + dynamic pickupDateTime; + dynamic pickupLocationName; + dynamic dropoffLocationName; int realRRTHaveTransactions; - String nearestProjectDescription; - String nearestProjectDescriptionN; - String projectDescription; - String projectDescriptionN; + dynamic nearestProjectDescription; + dynamic nearestProjectDescriptionN; + dynamic projectDescription; + dynamic projectDescriptionN; PrescriptionsOrder( {this.iD, diff --git a/lib/core/service/medical/ActiveMedicationsService.dart b/lib/core/service/medical/ActiveMedicationsService.dart new file mode 100644 index 00000000..070b7e5f --- /dev/null +++ b/lib/core/service/medical/ActiveMedicationsService.dart @@ -0,0 +1,27 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/active_medications/ActivePrescriptionReport.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; + +class ActiveMedicationsService extends BaseService{ + + List activePrescriptionReport = List(); + + getActiveMedication() async { + hasError = false; + super.error = ""; + Map body = Map(); + body['isDentalAllowedBackend'] = false; + await baseAppClient.post(ADD_ACTIVE_PRESCRIPTIONS_REPORT_BY_PATIENT_ID, + onSuccess: (response, statusCode) async { + activePrescriptionReport.clear(); + response['List_ActiveGetPrescriptionReportByPatientID'].forEach((appoitment) { + activePrescriptionReport + .add(ActivePrescriptionReport.fromJson(appoitment)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + +} \ No newline at end of file diff --git a/lib/core/service/medical/AllergiesService.dart b/lib/core/service/medical/AllergiesService.dart new file mode 100644 index 00000000..d3deae2b --- /dev/null +++ b/lib/core/service/medical/AllergiesService.dart @@ -0,0 +1,25 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/Allergy/Allergy.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; + +class AllergiesService extends BaseService { + List allergies = List(); + + getAllergies() async { + hasError = false; + super.error = ""; + Map body = Map(); + body['isDentalAllowedBackend'] = false; + body['OutSA'] = 0; + await baseAppClient.post(GET_PATIENT_ALLERGIES, + onSuccess: (response, statusCode) async { + allergies.clear(); + response['Patient_Allergies'].forEach((allergy) { + allergies.add(Allergy.fromJson(allergy)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } +} diff --git a/lib/core/service/medical/BloodPressureService.dart b/lib/core/service/medical/BloodPressureService.dart new file mode 100644 index 00000000..048c98e9 --- /dev/null +++ b/lib/core/service/medical/BloodPressureService.dart @@ -0,0 +1,100 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_pressur/BloodPressureResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_pressur/MonthBloodPressureResultAverage.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_pressur/WeekBloodPressureResultAverage.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_pressur/YearBloodPressureResultAverage.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/MonthDiabtectResultAverage.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/WeekDiabtectResultAverage.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/YearDiabtecResultAverage.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; + +class BloodPressureService extends BaseService { + List monthDiabtectResultAverageList = List(); + List weekDiabtectResultAverageList = List(); + List yearDiabtecResultAverageList = List(); + + ///Result + List monthDiabtecPatientResult = List(); + List weekDiabtecPatientResult = List(); + List yearDiabtecPatientResult = List(); + + Future getBloodSugar() async { + hasError = false; + Map body = Map(); + body['isDentalAllowedBackend'] = false; + await baseAppClient.post(GET_BLOOD_PRESSURE_RESULT_AVERAGE, + onSuccess: (dynamic response, int statusCode) { + monthDiabtectResultAverageList.clear(); + weekDiabtectResultAverageList.clear(); + yearDiabtecResultAverageList.clear(); + response['List_MonthBloodPressureResultAverage'].forEach((item) { + monthDiabtectResultAverageList + .add(MonthBloodPressureResultAverage.fromJson(item)); + }); + + response['List_WeekBloodPressureResultAverage'].forEach((item) { + weekDiabtectResultAverageList + .add(WeekBloodPressureResultAverage.fromJson(item)); + }); + + response['List_YearBloodPressureResultAverage'].forEach((item) { + yearDiabtecResultAverageList + .add(YearBloodPressureResultAverage.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + Future getDiabtecResults() async { + hasError = false; + await baseAppClient.post(GET_BLOOD_PRESSURE_RESULT, + onSuccess: (dynamic response, int statusCode) { + monthDiabtecPatientResult.clear(); + weekDiabtecPatientResult.clear(); + yearDiabtecPatientResult.clear(); + + response['List_WeekBloodPressureResult'].forEach((item) { + weekDiabtecPatientResult.add(BloodPressureResult.fromJson(item)); + }); + + response['List_MonthBloodPressureResult'].forEach((item) { + monthDiabtecPatientResult.add(BloodPressureResult.fromJson(item)); + }); + + response['List_YearBloodPressureResult'].forEach((item) { + yearDiabtecPatientResult.add(BloodPressureResult.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: Map()); + } + + addDiabtecResult( + {String bloodPressureDate, + String diastolicPressure, + String systolicePressure, + int measuredArm}) async { + hasError = false; + super.error = ""; + + Map body = Map(); + body['BloodPressureDate'] = bloodPressureDate; + body['DiastolicPressure'] = diastolicPressure; + body['SystolicePressure'] = systolicePressure; + body['MeasuredArm'] = measuredArm; + body['isDentalAllowedBackend'] = false; + + await baseAppClient.post(ADD_BLOOD_PRESSURE_RESULT, + onSuccess: (response, statusCode) async { + + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } +} diff --git a/lib/core/service/medical/BloodSugarService.dart b/lib/core/service/medical/BloodSugarService.dart new file mode 100644 index 00000000..09fe9fe9 --- /dev/null +++ b/lib/core/service/medical/BloodSugarService.dart @@ -0,0 +1,96 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/MonthDiabtectResultAverage.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/WeekDiabtectResultAverage.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/YearDiabtecResultAverage.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; + +class BloodSugarService extends BaseService { + List monthDiabtectResultAverageList = List(); + List weekDiabtectResultAverageList = List(); + List yearDiabtecResultAverageList = List(); + + ///Result + List monthDiabtecPatientResult = List(); + List weekDiabtecPatientResult = List(); + List yearDiabtecPatientResult = List(); + + Future getBloodSugar() async { + hasError = false; + Map body = Map(); + body['isDentalAllowedBackend'] = false; + await baseAppClient.post(GET_DIABETIC_RESULT_AVERAGE, + onSuccess: (dynamic response, int statusCode) { + monthDiabtectResultAverageList.clear(); + weekDiabtectResultAverageList.clear(); + yearDiabtecResultAverageList.clear(); + response['List_MonthDiabtectResultAverage'].forEach((item) { + monthDiabtectResultAverageList + .add(MonthDiabtectResultAverage.fromJson(item)); + }); + + response['List_WeekDiabtectResultAverage'].forEach((item) { + weekDiabtectResultAverageList + .add(WeekDiabtectResultAverage.fromJson(item)); + }); + + response['List_YearDiabtecResultAverage'].forEach((item) { + yearDiabtecResultAverageList + .add(YearDiabtecResultAverage.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + Future getDiabtecResults() async { + hasError = false; + await baseAppClient.post(GET_DIABTEC_RESULT, + onSuccess: (dynamic response, int statusCode) { + monthDiabtecPatientResult.clear(); + weekDiabtecPatientResult.clear(); + yearDiabtecPatientResult.clear(); + + response['List_MonthDiabtecPatientResult'].forEach((item) { + monthDiabtecPatientResult.add(DiabtecPatientResult.fromJson(item)); + }); + + response['List_WeekDiabtecPatientResult'].forEach((item) { + weekDiabtecPatientResult.add(DiabtecPatientResult.fromJson(item)); + }); + + response['List_YearDiabtecPatientResult'].forEach((item) { + yearDiabtecPatientResult.add(DiabtecPatientResult.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: Map()); + } + + addDiabtecResult( + {String bloodSugerDateChart, + String bloodSugerResult, + String diabtecUnit, + int measuredTime}) async { + hasError = false; + super.error = ""; + + Map body = Map(); + body['BloodSugerDateChart'] = bloodSugerDateChart; + body['BloodSugerResult'] = bloodSugerResult; + body['DiabtecUnit'] = diabtecUnit; + body['MeasuredTime'] =2;// measuredTime; + body['isDentalAllowedBackend'] = false; + + await baseAppClient.post(ADD_BLOOD_PRESSURE_RESULT, + onSuccess: (response, statusCode) async { + var asd =""; + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } +} diff --git a/lib/core/service/medical/EyeService.dart b/lib/core/service/medical/EyeService.dart new file mode 100644 index 00000000..879acbbf --- /dev/null +++ b/lib/core/service/medical/EyeService.dart @@ -0,0 +1,26 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/eye/AppoimentAllHistoryResult.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; + +class EyeService extends BaseService { + List appoimentAllHistoryResultList = List(); + + getEyeMeasurement() async { + hasError = false; + super.error = ""; + Map body = Map(); + body['isDentalAllowedBackend'] = false; + body['IsIrisPrescription'] = true; + await baseAppClient.post(GET_PATIENT_APPOINTMENT_HISTORY, + onSuccess: (response, statusCode) async { + appoimentAllHistoryResultList.clear(); + response['AppoimentAllHistoryResultList'].forEach((appoitment) { + appoimentAllHistoryResultList + .add(AppoimentAllHistoryResultList.fromJson(appoitment)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } +} diff --git a/lib/core/service/medical/WeightPressureService.dart b/lib/core/service/medical/WeightPressureService.dart new file mode 100644 index 00000000..006de821 --- /dev/null +++ b/lib/core/service/medical/WeightPressureService.dart @@ -0,0 +1,104 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_pressur/BloodPressureResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_pressur/MonthBloodPressureResultAverage.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_pressur/WeekBloodPressureResultAverage.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_pressur/YearBloodPressureResultAverage.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/MonthDiabtectResultAverage.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/WeekDiabtectResultAverage.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/YearDiabtecResultAverage.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/weight/MonthWeightMeasurementResultAverage.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/weight/WeekWeightMeasurementResultAverage.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/weight/WeightMeasurementResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/weight/YearWeightMeasurementResultAverage.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; + +class WeightService extends BaseService { + + ///Average + List monthWeightMeasurementResultAverage = List(); + List weekWeightMeasurementResultAverage = List(); + List yearWeightMeasurementResultAverage = List(); + + ///Result + List monthWeightMeasurementResult = List(); + List weekWeightMeasurementResult = List(); + List yearWeightMeasurementResult = List(); + + Future getWeightAverage() async { + hasError = false; + Map body = Map(); + body['isDentalAllowedBackend'] = false; + await baseAppClient.post(GET_WEIGHT_PRESSURE_RESULT_AVERAGE, + onSuccess: (dynamic response, int statusCode) { + monthWeightMeasurementResultAverage.clear(); + weekWeightMeasurementResultAverage.clear(); + yearWeightMeasurementResultAverage.clear(); + response['List_MonthWeightMeasurementResultAverage'].forEach((item) { + monthWeightMeasurementResultAverage + .add(MonthWeightMeasurementResultAverage.fromJson(item)); + }); + + response['List_WeekWeightMeasurementResultAverage'].forEach((item) { + weekWeightMeasurementResultAverage + .add(WeekWeightMeasurementResultAverage.fromJson(item)); + }); + + response['List_YearWeightMeasurementResultAverage'].forEach((item) { + yearWeightMeasurementResultAverage + .add(YearWeightMeasurementResultAverage.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + Future getWeightMeasurementResult() async { + hasError = false; + await baseAppClient.post(GET_WEIGHT_PRESSURE_RESULT, + onSuccess: (dynamic response, int statusCode) { + monthWeightMeasurementResult.clear(); + weekWeightMeasurementResult.clear(); + yearWeightMeasurementResult.clear(); + + response['List_WeekWeightMeasurementResult'].forEach((item) { + weekWeightMeasurementResult.add(WeightMeasurementResult.fromJson(item)); + }); + + response['List_MonthWeightMeasurementResult'].forEach((item) { + monthWeightMeasurementResult.add(WeightMeasurementResult.fromJson(item)); + }); + + response['List_YearWeightMeasurementResult'].forEach((item) { + yearWeightMeasurementResult.add(WeightMeasurementResult.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: Map()); + } + + addWeightResult( + {String weightDate, + String weightMeasured, + int weightUnit}) async { + hasError = false; + super.error = ""; + + Map body = Map(); + body['WeightDate'] = weightDate; + body['WeightMeasured'] = weightMeasured; + body['weightUnit'] = weightUnit; + body['isDentalAllowedBackend'] = false; + + await baseAppClient.post(ADD_WEIGHT_PRESSURE_RESULT, + onSuccess: (response, statusCode) async { + + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } +} diff --git a/lib/core/service/medical/ask_doctor_services.dart b/lib/core/service/medical/ask_doctor_services.dart new file mode 100644 index 00000000..9a819a6e --- /dev/null +++ b/lib/core/service/medical/ask_doctor_services.dart @@ -0,0 +1,106 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/ask_doctor/AskDoctorReqTypes.dart'; +import 'package:diplomaticquarterapp/core/model/ask_doctor/DoctorResponse.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; + +class AskDoctorService extends BaseService { + List askDoctorReqTypes = List(); + List doctorResponseList = List(); + + Future getCallInfoHoursResult({int projectId, int doctorId}) async { + hasError = false; + Map body = Map(); + body['isDentalAllowedBackend'] = false; + body['DoctorID'] = doctorId; + body['ProjectID'] = projectId; + + await baseAppClient.post(GET_CALL_INFO_HOURS_RESULT, + onSuccess: (dynamic response, int statusCode) { + ///OKAY + var asd=""; + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + Future getCallRequestTypeLOV() async { + hasError =false; + Map body = Map(); + body['isDentalAllowedBackend'] = false; + await baseAppClient.post(GET_CALL_REQUEST_TYPE_LOV, + onSuccess: (dynamic response, int statusCode) { + askDoctorReqTypes.clear(); + response['ListReqTypes'].forEach((reqType) { + askDoctorReqTypes.add(AskDoctorReqTypes.fromJson(reqType)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + Future getDoctorResponse() async { + hasError =false; + Map body = Map(); + body['isDentalAllowedBackend'] = false; + body['from'] = + "${DateTime.now().year}-${DateTime.now().month}-${DateTime.now().day} 00:00:00"; + body['from'] = + "${DateTime.now().year}-${DateTime.now().month}-${DateTime.now().day} ${DateTime.now().hour}:${DateTime.now().minute}:00"; + await baseAppClient.post(GET_DOCTOR_RESPONSE, + onSuccess: (dynamic response, int statusCode) { + doctorResponseList.clear(); + response['List_DoctorResponse'].forEach((reqType) { + doctorResponseList.add(DoctorResponse.fromJson(reqType)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + Future updateReadStatus({int transactionNo}) async { + hasError =false; + Map body = Map(); + body['isDentalAllowedBackend'] = false; + body['TransactionNo'] = transactionNo; + await baseAppClient.post(UPDATE_READ_STATUS, + onSuccess: (dynamic response, int statusCode) { + //TODO fix it + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + + Future sendRequestLOV({DoctorList doctorList,String requestType,String remark}) async { + hasError =false; + Map body = Map(); + body['ProjectID'] = doctorList.projectID; + body['SetupID'] = doctorList.setupID; + body['DoctorID'] = doctorList.doctorID; + body['PatientMobileNumber'] = user.mobileNumber; + body['IsMessageSent'] = false; + body['RequestDate'] = DateUtil.yearMonthDay(DateTime.now()); + body['RequestTime'] = DateUtil.time(DateTime.now()); + body['Remarks'] = remark; + body['Status'] = 2;// 4 for testing only.."cancelled status insert" else should be changed to 1 in live version + body['CreatedBy'] = 102; + body['CreatedOn'] = DateUtil.yearMonthDay(DateTime.now()); + body['EditedBy'] = 102; + body['EditedOn'] = DateUtil.yearMonthDay(DateTime.now()); + body['isDentalAllowedBackend'] = false; + await baseAppClient.post(INSERT_CALL_INFO, + onSuccess: (dynamic response, int statusCode) { + + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + +} diff --git a/lib/core/service/medical/my_doctor_service.dart b/lib/core/service/medical/my_doctor_service.dart index 4df3ce8a..f2ba067a 100644 --- a/lib/core/service/medical/my_doctor_service.dart +++ b/lib/core/service/medical/my_doctor_service.dart @@ -15,22 +15,8 @@ class MyDoctorService extends BaseService { RequestPatientDoctorAppointment patientDoctorAppointmentRequest = RequestPatientDoctorAppointment( - top: 0, - versionID: 5.5, - beforeDays: 0, - exludType: 4, - channel: 3, - languageID: 2, - iPAdress: '10.20.10.20', - generalid: 'Cs2020@2016\$2958', - patientOutSA: 0, - sessionID: 'TMRhVmkGhOsvamErw', - isDentalAllowedBackend: false, - deviceTypeID: 1, - patientID: 1231755, - tokenID: '@dm!n', - patientType: 1, - patientTypeID: 1); + isDentalAllowedBackend: false, + ); RequestDoctorRating _requestDoctorRating = RequestDoctorRating( channel: 3, @@ -44,7 +30,12 @@ class MyDoctorService extends BaseService { generalid: 'Cs2020@2016\$2958', isDentalAllowedBackend: false); - Future getPatientDoctorAppointmentList() async { + Future getPatientDoctorAppointmentList({int top = 0, int beforeDays = 0,int exludType=4}) async { + hasError = false; + patientDoctorAppointmentRequest.top = top; + patientDoctorAppointmentRequest.beforeDays = beforeDays; + patientDoctorAppointmentRequest.exludType = exludType; + await baseAppClient.post(GET_MY_DOCTOR, onSuccess: (dynamic response, int statusCode) { patientDoctorAppointmentList.clear(); @@ -75,7 +66,8 @@ class MyDoctorService extends BaseService { deviceTypeID: 2, ); - Future getDoctorProfileAndRating({int doctorId,int clinicID,int projectID }) async { + Future getDoctorProfileAndRating( + {int doctorId, int clinicID, int projectID}) async { ///GET DOCTOR PROFILE _requestDoctorProfile.doctorID = doctorId; _requestDoctorProfile.clinicID = clinicID; @@ -89,8 +81,6 @@ class MyDoctorService extends BaseService { doctorList.doctorTitle = doctorProfile.doctorTitleForProfile; doctorList.name = doctorProfile.doctorName; doctorList.projectName = doctorProfile.projectName; - - }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; diff --git a/lib/core/viewModels/base_view_model.dart b/lib/core/viewModels/base_view_model.dart index 74899fae..3d7122bd 100644 --- a/lib/core/viewModels/base_view_model.dart +++ b/lib/core/viewModels/base_view_model.dart @@ -18,7 +18,11 @@ class BaseViewModel extends ChangeNotifier { void setState(ViewState viewState) { _state = viewState; - notifyListeners(); + + if (viewState == ViewState.Busy || viewState == ViewState.BusyLocal) + error = ""; + + if (hasListeners) notifyListeners(); } BaseViewModel() { @@ -34,4 +38,10 @@ class BaseViewModel extends ChangeNotifier { notifyListeners(); } + + @override + void dispose() { + removeListener(() {}); + super.dispose(); + } } diff --git a/lib/core/viewModels/medical/ActiveMedicationsViewModel.dart b/lib/core/viewModels/medical/ActiveMedicationsViewModel.dart new file mode 100644 index 00000000..ee4f37c5 --- /dev/null +++ b/lib/core/viewModels/medical/ActiveMedicationsViewModel.dart @@ -0,0 +1,28 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/active_medications/ActivePrescriptionReport.dart'; +import 'package:diplomaticquarterapp/core/service/medical/ActiveMedicationsService.dart'; +import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; +import 'package:diplomaticquarterapp/locator.dart'; + +class ActiveMedicationsViewModel extends BaseViewModel { + ActiveMedicationsService _activeMedicationsService = + locator(); + + List get activePrescriptionReport => + _activeMedicationsService.activePrescriptionReport; + + getActiveMedication() async { + setState(ViewState.Busy); + await _activeMedicationsService.getActiveMedication(); + if (_activeMedicationsService.hasError) { + error = _activeMedicationsService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + + + + +} diff --git a/lib/core/viewModels/medical/AllergiesViewModel.dart b/lib/core/viewModels/medical/AllergiesViewModel.dart new file mode 100644 index 00000000..bc4666bc --- /dev/null +++ b/lib/core/viewModels/medical/AllergiesViewModel.dart @@ -0,0 +1,22 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/Allergy/Allergy.dart'; +import 'package:diplomaticquarterapp/core/service/medical/AllergiesService.dart'; +import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; + +import '../../../locator.dart'; + +class AllergiesViewModel extends BaseViewModel { + AllergiesService _allergiesService = locator(); + List get allergies => _allergiesService.allergies; + + getAllergies() async { + setState(ViewState.Busy); + await _allergiesService.getAllergies(); + if (_allergiesService.hasError) { + error = _allergiesService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } +} diff --git a/lib/core/viewModels/medical/EyeViewModel.dart b/lib/core/viewModels/medical/EyeViewModel.dart new file mode 100644 index 00000000..d6c3bf80 --- /dev/null +++ b/lib/core/viewModels/medical/EyeViewModel.dart @@ -0,0 +1,46 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/eye/AppoimentAllHistoryResult.dart'; +import 'package:diplomaticquarterapp/core/model/eye/AppointmentFilter.dart'; +import 'package:diplomaticquarterapp/core/service/medical/EyeService.dart'; +import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; +import 'package:diplomaticquarterapp/locator.dart'; + +class EyeViewModel extends BaseViewModel { + EyeService _eyeService = locator(); + + List get appoimentAllHistoryResultList => + _eyeService.appoimentAllHistoryResultList; + + List appointmentFilter = List(); + + getEyeMeasurement() async { + setState(ViewState.Busy); + await _eyeService.getEyeMeasurement(); + if (_eyeService.hasError) { + error = _eyeService.error; + setState(ViewState.Error); + } else { + _eyeService.appoimentAllHistoryResultList.forEach((element) { + List _appointmentFilter = appointmentFilter + .where( + (elementFilter) => + elementFilter.filterName == element.projectName, + ) + .toList(); + + if (_appointmentFilter.length != 0) { + appointmentFilter[appointmentFilter.indexOf(_appointmentFilter[0])] + .appointmentAllHistoryResultList + .add(element); + } else { + appointmentFilter.add(AppointmentFilter( + element, + element.projectName, + )); + } + }); + + setState(ViewState.Idle); + } + } +} diff --git a/lib/core/viewModels/medical/ask_doctor_view_model.dart b/lib/core/viewModels/medical/ask_doctor_view_model.dart new file mode 100644 index 00000000..629df0a9 --- /dev/null +++ b/lib/core/viewModels/medical/ask_doctor_view_model.dart @@ -0,0 +1,110 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/ask_doctor/AskDoctorReqTypes.dart'; +import 'package:diplomaticquarterapp/core/model/ask_doctor/DoctorResponse.dart'; +import 'package:diplomaticquarterapp/core/service/medical/ask_doctor_services.dart'; +import 'package:diplomaticquarterapp/core/service/medical/my_doctor_service.dart'; +import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; +import 'package:diplomaticquarterapp/locator.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; + +class AskDoctorViewModel extends BaseViewModel { + AskDoctorService _askDoctorService = locator(); + MyDoctorService _myDoctorService = locator(); + + List patientDoctorAppointmentListHospital = + List(); + + List get askDoctorReqTypes => + _askDoctorService.askDoctorReqTypes; + + List get doctorResponseList => + _askDoctorService.doctorResponseList; + + Future getMyDoctor() async { + setState(ViewState.Busy); + await _myDoctorService.getPatientDoctorAppointmentList( + top: 25, beforeDays: 15); + if (_myDoctorService.hasError) { + error = _myDoctorService.error; + setState(ViewState.Error); + } else + var asd = ""; + _myDoctorService.patientDoctorAppointmentList.forEach((element) { + List doctorByClinic = + patientDoctorAppointmentListHospital + .where((elementClinic) => + elementClinic.filterName == element.projectName) + .toList(); + + if (doctorByClinic.length != 0) { + patientDoctorAppointmentListHospital[ + patientDoctorAppointmentListHospital.indexOf(doctorByClinic[0])] + .patientDoctorAppointmentList + .add(element); + } else { + patientDoctorAppointmentListHospital.add(PatientDoctorAppointmentList( + filterName: element.projectName, + patientDoctorAppointment: element)); + } + + setState(ViewState.Idle); + }); + } + + Future getCallRequestTypeLOVs() async { + setState(ViewState.Busy); + await _askDoctorService.getCallRequestTypeLOV(); + if (_askDoctorService.hasError) { + error = _askDoctorService.error; + setState(ViewState.ErrorLocal); + AppToast.showErrorToast(message: error); + } else + setState(ViewState.Idle); + } + + Future getCallInfoHoursResult({int projectId, int doctorId}) async { + setState(ViewState.Busy); + await _askDoctorService.getCallInfoHoursResult( + projectId: projectId, doctorId: doctorId); + if (_askDoctorService.hasError) { + error = _askDoctorService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + + getDoctorResponse() async { + setState(ViewState.Busy); + await _askDoctorService.getDoctorResponse(); + if (_askDoctorService.hasError) { + error = _askDoctorService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + + Future updateReadStatus({int transactionNo}) async { + setState(ViewState.Busy); + await _askDoctorService.updateReadStatus(transactionNo: transactionNo); + if (_askDoctorService.hasError) { + error = _askDoctorService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + + Future sendRequestLOV( + {DoctorList doctorList, String requestType, String remark}) async { + setState(ViewState.BusyLocal); + await _askDoctorService.sendRequestLOV( + doctorList: doctorList, requestType: requestType, remark: remark); + if (_askDoctorService.hasError) { + error = _askDoctorService.error; + setState(ViewState.ErrorLocal); + AppToast.showErrorToast(message: error); + } else + setState(ViewState.Idle); + } +} diff --git a/lib/core/viewModels/medical/blood_pressure_view_model.dart b/lib/core/viewModels/medical/blood_pressure_view_model.dart new file mode 100644 index 00000000..dfff5b45 --- /dev/null +++ b/lib/core/viewModels/medical/blood_pressure_view_model.dart @@ -0,0 +1,151 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_pressur/BloodPressureResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/YearMonthlyChartDate.dart'; +import 'package:diplomaticquarterapp/core/service/medical/BloodPressureService.dart'; +import 'package:diplomaticquarterapp/core/service/medical/BloodSugarService.dart'; +import 'package:diplomaticquarterapp/locator.dart'; +import 'package:charts_flutter/flutter.dart' as charts; + +import '../../../core/viewModels/base_view_model.dart'; + +class BloodPressureViewMode extends BaseViewModel { + BloodPressureService bloodPressureService = locator(); + + ///BLOOD + List _bloodDiastolicPressureWeeklyTimeSeriesSalesList = List(); + List _bloodSystolicePressureWeeklyTimeSeriesSalesList = List(); + + List _bloodDiastolicMonthlyTimeSeriesSalesList = List(); + List _bloodSystolicMonthlyTimeSeriesSalesList = List(); + + List _bloodSystoliceYearTimeSeriesSalesList = List(); + List _bloodDiastolicYearTimeSeriesSalesList = List(); + + List get monthDiabtecPatientResult => bloodPressureService.monthDiabtecPatientResult; + + List get weekDiabtecPatientResult => bloodPressureService.weekDiabtecPatientResult; + + List get yearDiabtecPatientResult => bloodPressureService.yearDiabtecPatientResult; + + Future getBloodPressure() async { + setState(ViewState.Busy); + await bloodPressureService.getBloodSugar(); + await bloodPressureService.getDiabtecResults(); + if (bloodPressureService.hasError) { + error = bloodPressureService.error; + setState(ViewState.Error); + } else { + bloodPressureService.weekDiabtectResultAverageList.forEach((element) { + _bloodDiastolicPressureWeeklyTimeSeriesSalesList.add(WeekChartDate( + x: element.bloodPressureDate, + y: element.dailyDiastolicPressureAverageResult)); + _bloodSystolicePressureWeeklyTimeSeriesSalesList.add(WeekChartDate( + x: element.bloodPressureDate, + y: element.dailySystolicePressureAverageResult)); + }); + + for (int index = 0; + index < bloodPressureService.monthDiabtectResultAverageList.length; + index++) { + _bloodDiastolicMonthlyTimeSeriesSalesList.add(YearMonthlyChartDate( + x: index, + y: bloodPressureService.monthDiabtectResultAverageList[index] + .weekDiastolicPressureAverageResult)); + _bloodSystolicMonthlyTimeSeriesSalesList.add(YearMonthlyChartDate( + x: index, + y: bloodPressureService.monthDiabtectResultAverageList[index] + .weekSystolicePressureAverageResult)); + } + + bloodPressureService.yearDiabtecResultAverageList.forEach((element) { + _bloodSystoliceYearTimeSeriesSalesList + .add(WeekChartDate(x: element.date, y: element.monthSystolicePressureAverageResult)); + + _bloodDiastolicYearTimeSeriesSalesList + .add(WeekChartDate(x: element.date, y: element.monthDiastolicPressureAverageResult)); + }); + + setState(ViewState.Idle); + } + } + + List> getBloodWeeklySeries() { + return [ + charts.Series( + id: 'Diastolic', + colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault, + domainFn: (WeekChartDate sales, _) => sales.x, + measureFn: (WeekChartDate sales, _) => sales.y, + data: _bloodDiastolicPressureWeeklyTimeSeriesSalesList, + ), + charts.Series( + id: 'Systolice', + colorFn: (_, __) => charts.MaterialPalette.blue.shadeDefault, + domainFn: (WeekChartDate sales, _) => sales.x, + measureFn: (WeekChartDate sales, _) => sales.y, + data: _bloodSystolicePressureWeeklyTimeSeriesSalesList, + ) + ]; + } + + List> + getBloodMonthlyTimeSeriesSales() { + return [ + charts.Series( + id: 'Sales', + colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault, + domainFn: (YearMonthlyChartDate sales, _) => sales.x, + measureFn: (YearMonthlyChartDate sales, _) => sales.y, + data: _bloodDiastolicMonthlyTimeSeriesSalesList, + ), + charts.Series( + id: 'Sales', + colorFn: (_, __) => charts.MaterialPalette.blue.shadeDefault, + domainFn: (YearMonthlyChartDate sales, _) => sales.x, + measureFn: (YearMonthlyChartDate sales, _) => sales.y, + data: _bloodSystolicMonthlyTimeSeriesSalesList, + ), + ]; + } + + List> getBloodYearTimeSeriesSales() { + return [ + charts.Series( + id: 'Sales', + colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault, + domainFn: (WeekChartDate sales, _) => sales.x, + measureFn: (WeekChartDate sales, _) => sales.y, + data: _bloodSystoliceYearTimeSeriesSalesList, + ), + charts.Series( + id: 'Sales', + colorFn: (_, __) => charts.MaterialPalette.blue.shadeDefault, + domainFn: (WeekChartDate sales, _) => sales.x, + measureFn: (WeekChartDate sales, _) => sales.y, + data: _bloodDiastolicYearTimeSeriesSalesList, + ) + ]; + } + + addDiabtecResult( + {String bloodPressureDate, + String diastolicPressure, + String systolicePressure, + int measuredArm}) async { + setState(ViewState.BusyLocal); + await bloodPressureService.addDiabtecResult( + bloodPressureDate: bloodPressureDate, + diastolicPressure: diastolicPressure, + systolicePressure: systolicePressure, + measuredArm: measuredArm); + if (bloodPressureService.hasError) { + error = bloodPressureService.error; + setState(ViewState.Error); + } else { + await getBloodPressure(); + setState(ViewState.Idle); + } + } +} diff --git a/lib/core/viewModels/medical/blood_sugar_view_model.dart b/lib/core/viewModels/medical/blood_sugar_view_model.dart new file mode 100644 index 00000000..fb00f80e --- /dev/null +++ b/lib/core/viewModels/medical/blood_sugar_view_model.dart @@ -0,0 +1,119 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/YearMonthlyChartDate.dart'; +import 'package:diplomaticquarterapp/core/service/medical/BloodSugarService.dart'; +import 'package:diplomaticquarterapp/locator.dart'; +import 'package:charts_flutter/flutter.dart' as charts; + +import '../../../core/viewModels/base_view_model.dart'; + +class BloodSugarViewMode extends BaseViewModel { + BloodSugarService bloodSugarService = locator(); + + ///BLOOD + List _bloodWeeklyTimeSeriesSalesList = List(); + List _bloodMonthlyTimeSeriesSalesList = List(); + List _bloodYearTimeSeriesSalesList = List(); + + List get monthDiabtecPatientResult => + bloodSugarService.monthDiabtecPatientResult; + + List get weekDiabtecPatientResult => + bloodSugarService.weekDiabtecPatientResult; + + List get yearDiabtecPatientResult => + bloodSugarService.yearDiabtecPatientResult; + + Future getBloodSugar() async { + setState(ViewState.Busy); + await bloodSugarService.getBloodSugar(); + await bloodSugarService.getDiabtecResults(); + if (bloodSugarService.hasError) { + error = bloodSugarService.error; + setState(ViewState.Error); + } else { + bloodSugarService.weekDiabtectResultAverageList.forEach((element) { + _bloodWeeklyTimeSeriesSalesList.add( + WeekChartDate(x: element.dateChart, y: element.dailyAverageResult)); + }); + + for (int index = 0; + index < bloodSugarService.monthDiabtectResultAverageList.length; + index++) { + _bloodMonthlyTimeSeriesSalesList.add(YearMonthlyChartDate( + x: index, + y: bloodSugarService + .monthDiabtectResultAverageList[index].weekAverageResult)); + var asd=""; + } + + bloodSugarService.yearDiabtecResultAverageList.forEach((element) { + _bloodYearTimeSeriesSalesList + .add(WeekChartDate(x: element.date, y: element.monthAverageResult)); + }); + + setState(ViewState.Idle); + } + } + + List> getBloodWeeklySeries() { + return [ + new charts.Series( + id: 'Sales', + colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault, + domainFn: (WeekChartDate sales, _) => sales.x, + measureFn: (WeekChartDate sales, _) => sales.y, + data: _bloodWeeklyTimeSeriesSalesList, + ) + ]; + } + + List> + getBloodMonthlyTimeSeriesSales() { + return [ + new charts.Series( + id: 'Sales', + colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault, + domainFn: (YearMonthlyChartDate sales, _) => sales.x, + measureFn: (YearMonthlyChartDate sales, _) => sales.y, + data: _bloodMonthlyTimeSeriesSalesList, + ) + ]; + } + + List> getBloodYearTimeSeriesSales() { + return [ + new charts.Series( + id: 'Sales', + colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault, + domainFn: (WeekChartDate sales, _) => sales.x, + measureFn: (WeekChartDate sales, _) => sales.y, + data: _bloodYearTimeSeriesSalesList, + ) + ]; + } + + addDiabtecResult( + {String bloodSugerDateChart, + String bloodSugerResult, + String diabtecUnit, + int measuredTime}) async { + setState(ViewState.BusyLocal); + await bloodSugarService.addDiabtecResult( + bloodSugerDateChart: bloodSugerDateChart, + bloodSugerResult: bloodSugerResult , + diabtecUnit: diabtecUnit, + measuredTime: measuredTime); + if (bloodSugarService.hasError) { + error = bloodSugarService.error; + setState(ViewState.Error); + } else { + await getBloodSugar(); + setState(ViewState.Idle); + } + } + + + +} diff --git a/lib/core/viewModels/medical/medical_view_model.dart b/lib/core/viewModels/medical/medical_view_model.dart index 59e8db48..fa330aad 100644 --- a/lib/core/viewModels/medical/medical_view_model.dart +++ b/lib/core/viewModels/medical/medical_view_model.dart @@ -10,9 +10,10 @@ class MedicalViewModel extends BaseViewModel { List get appoitmentAllHistoryResultList => _medicalService.appoitmentAllHistoryResultList; - getAppointmentHistory() async{ + getAppointmentHistory() async { setState(ViewState.Busy); - await _medicalService.getAppointmentHistory(); + if (_medicalService.appoitmentAllHistoryResultList.length == 0) + await _medicalService.getAppointmentHistory(); if (_medicalService.hasError) { error = _medicalService.error; setState(ViewState.Error); diff --git a/lib/core/viewModels/medical/weight_pressure_view_model.dart b/lib/core/viewModels/medical/weight_pressure_view_model.dart new file mode 100644 index 00000000..29095895 --- /dev/null +++ b/lib/core/viewModels/medical/weight_pressure_view_model.dart @@ -0,0 +1,113 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_pressur/BloodPressureResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/YearMonthlyChartDate.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/weight/WeightMeasurementResult.dart'; +import 'package:diplomaticquarterapp/core/service/medical/BloodPressureService.dart'; +import 'package:diplomaticquarterapp/core/service/medical/BloodSugarService.dart'; +import 'package:diplomaticquarterapp/core/service/medical/WeightPressureService.dart'; +import 'package:diplomaticquarterapp/locator.dart'; +import 'package:charts_flutter/flutter.dart' as charts; + +import '../../../core/viewModels/base_view_model.dart'; + +class WeightPressureViewMode extends BaseViewModel { + WeightService weightService = locator(); + + List _weightWeeklyTimeSeriesSalesList = List(); + List _weightMonthlyTimeSeriesSalesList = List(); + List _weightYearTimeSeriesSalesList = List(); + + List get monthWeightMeasurementResult => + weightService.monthWeightMeasurementResult; + + List get weekWeightMeasurementResult => + weightService.weekWeightMeasurementResult; + + List get yearWeightMeasurementResult => + weightService.yearWeightMeasurementResult; + + Future getWeight() async { + setState(ViewState.Busy); + await weightService.getWeightAverage(); + await weightService.getWeightMeasurementResult(); + if (weightService.hasError) { + error = weightService.error; + setState(ViewState.Error); + } else { + weightService.weekWeightMeasurementResultAverage.forEach((element) { + _weightWeeklyTimeSeriesSalesList.add(WeekChartDate( + x: element.weightDate, y: element.dailyAverageResult)); + }); + + for (int index = 0; + index < weightService.monthWeightMeasurementResultAverage.length; + index++) { + _weightMonthlyTimeSeriesSalesList.add(YearMonthlyChartDate( + x: index, + y: weightService.monthWeightMeasurementResultAverage[index].weekAverageResult)); + } + + weightService.yearWeightMeasurementResultAverage.forEach((element) { + _weightYearTimeSeriesSalesList + .add(WeekChartDate(x: element.date, y: element.monthAverageResult)); + }); + + setState(ViewState.Idle); + } + } + + List> getWeightWeeklySeries() { + return [ + charts.Series( + id: 'Diastolic', + colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault, + domainFn: (WeekChartDate sales, _) => sales.x, + measureFn: (WeekChartDate sales, _) => sales.y, + data: _weightWeeklyTimeSeriesSalesList, + ), + ]; + } + + List> + getWeightMonthlyTimeSeriesSales() { + return [ + charts.Series( + id: 'Sales', + colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault, + domainFn: (YearMonthlyChartDate sales, _) => sales.x, + measureFn: (YearMonthlyChartDate sales, _) => sales.y, + data: _weightMonthlyTimeSeriesSalesList, + ), + ]; + } + + List> getWeightYearTimeSeriesSales() { + return [ + charts.Series( + id: 'Sales', + colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault, + domainFn: (WeekChartDate sales, _) => sales.x, + measureFn: (WeekChartDate sales, _) => sales.y, + data: _weightYearTimeSeriesSalesList, + ), + ]; + } + + addWeightResult( + {String weightDate, String weightMeasured, int weightUnit}) async { + setState(ViewState.BusyLocal); + await weightService.addWeightResult( + weightDate: weightDate, + weightMeasured: weightMeasured, + weightUnit: weightUnit,); + if (weightService.hasError) { + error = weightService.error; + setState(ViewState.Error); + } else { + await getWeight(); + setState(ViewState.Idle); + } + } +} diff --git a/lib/core/viewModels/project_view_model.dart b/lib/core/viewModels/project_view_model.dart index 5975daf2..ea06c8ad 100644 --- a/lib/core/viewModels/project_view_model.dart +++ b/lib/core/viewModels/project_view_model.dart @@ -3,8 +3,10 @@ import 'dart:async'; import 'package:connectivity/connectivity.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; +import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:flutter/cupertino.dart'; +import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; class ProjectViewModel extends BaseViewModel { AppSharedPreferences sharedPref = AppSharedPreferences(); @@ -19,7 +21,9 @@ class ProjectViewModel extends BaseViewModel { dynamic get searchValue => searchvalue; Locale get appLocal => _appLocale; + LocaleType get localeType => isArabic? LocaleType.en:LocaleType.ar; bool get isArabic => _isArabic; + // BaseViewModel baseViewModel = locator() StreamSubscription subscription; ProjectViewModel() { diff --git a/lib/locator.dart b/lib/locator.dart index 02924e57..08a338df 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -14,7 +14,14 @@ import 'core/service/er/am_service.dart'; import 'core/service/er/er_service.dart'; import 'core/service/feedback/feedback_service.dart'; import 'core/service/hospital_service.dart'; +import 'core/service/medical/ActiveMedicationsService.dart'; +import 'core/service/medical/AllergiesService.dart'; +import 'core/service/medical/BloodPressureService.dart'; +import 'core/service/medical/BloodSugarService.dart'; +import 'core/service/medical/EyeService.dart'; import 'core/service/medical/PatientSickLeaveService.dart'; +import 'core/service/medical/WeightPressureService.dart'; +import 'core/service/medical/ask_doctor_services.dart'; import 'core/service/medical/labs_service.dart'; import 'core/service/medical/medical_service.dart'; import 'core/service/medical/my_balance_service.dart'; @@ -32,16 +39,23 @@ import 'core/viewModels/er/near_hospital_view_model.dart'; import 'core/viewModels/feedback/feedback_view_model.dart'; import 'core/service/medical/reports_service.dart'; import 'core/viewModels/hospital_view_model.dart'; +import 'core/viewModels/medical/ActiveMedicationsViewModel.dart'; +import 'core/viewModels/medical/AllergiesViewModel.dart'; +import 'core/viewModels/medical/EyeViewModel.dart'; +import 'core/viewModels/medical/ask_doctor_view_model.dart'; +import 'core/viewModels/medical/blood_pressure_view_model.dart'; import 'core/viewModels/medical/labs_view_model.dart'; import 'core/viewModels/medical/medical_view_model.dart'; import 'core/viewModels/medical/my_balance_view_model.dart'; import 'core/viewModels/medical/my_doctor_view_model.dart'; +import 'core/viewModels/medical/blood_sugar_view_model.dart'; import 'core/viewModels/medical/patient_sick_leave_view_model.dart'; import 'core/viewModels/medical/prescriptions_view_model.dart'; import 'core/viewModels/medical/radiology_view_model.dart'; import 'core/viewModels/medical/reports_monthly_view_model.dart'; import 'core/viewModels/medical/vital_sign_view_model.dart'; import 'core/viewModels/medical/reports_view_model.dart'; +import 'core/viewModels/medical/weight_pressure_view_model.dart'; import 'core/viewModels/pharmacies_view_model.dart'; import 'core/service/pharmacies_service.dart'; import 'core/service/insurance_service.dart'; @@ -79,6 +93,13 @@ void setupLocator() { locator.registerLazySingleton(() => PatientSickLeaveService()); locator.registerLazySingleton(() => MyBalanceService()); + locator.registerLazySingleton(() => BloodSugarService()); + locator.registerLazySingleton(() => BloodPressureService()); + locator.registerLazySingleton(() => WeightService()); + locator.registerLazySingleton(() => EyeService()); + locator.registerLazySingleton(() => ActiveMedicationsService()); + locator.registerLazySingleton(() => AskDoctorService()); + locator.registerLazySingleton(() => AllergiesService()); locator.registerLazySingleton(() => FindusService()); locator.registerLazySingleton(() => LiveChatService()); locator.registerLazySingleton(() => H2OService()); @@ -109,4 +130,11 @@ void setupLocator() { locator.registerFactory(() => LiveChatViewModel()); locator.registerFactory(() => H2OViewModel()); + locator.registerFactory(() => BloodSugarViewMode()); + locator.registerFactory(() => BloodPressureViewMode()); + locator.registerFactory(() => WeightPressureViewMode()); + locator.registerFactory(() => EyeViewModel()); + locator.registerFactory(() => ActiveMedicationsViewModel()); + locator.registerFactory(() => AskDoctorViewModel()); + locator.registerFactory(() => AllergiesViewModel()); } diff --git a/lib/pages/BookAppointment/widgets/DoctorView.dart b/lib/pages/BookAppointment/widgets/DoctorView.dart index d3150459..cad9da25 100644 --- a/lib/pages/BookAppointment/widgets/DoctorView.dart +++ b/lib/pages/BookAppointment/widgets/DoctorView.dart @@ -13,6 +13,7 @@ class DoctorView extends StatelessWidget { final DoctorList doctor; + DoctorView({@required this.doctor}); @override diff --git a/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart b/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart index 206a95c4..65e2d7b2 100644 --- a/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart +++ b/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart @@ -139,7 +139,7 @@ class _HospitalsLiveChatPageState extends State { IconButton( icon: Icon( Icons - .arrow_forward_rounded, + .arrow_forward, color: tappedIndex == index ? Colors.white diff --git a/lib/pages/base/base_view.dart b/lib/pages/base/base_view.dart index f6853123..6014b6c3 100644 --- a/lib/pages/base/base_view.dart +++ b/lib/pages/base/base_view.dart @@ -38,7 +38,10 @@ class _BaseViewState extends State> { @override void dispose() { - if (model != null) model = null; + if (model != null) { + model = null; + } + super.dispose(); } } diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index c442bc92..a545f8a7 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -1,4 +1,5 @@ import 'dart:io'; +import 'dart:typed_data'; import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; @@ -12,6 +13,8 @@ import 'package:diplomaticquarterapp/pages/livecare/incoming_call.dart'; import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.dart'; import 'package:diplomaticquarterapp/pages/medical/my_admissions_page.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; +import 'package:diplomaticquarterapp/uitl/CalendarUtils.dart'; +import 'package:diplomaticquarterapp/uitl/LocalNotification.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/bottom_navigation/bottom_nav_bar.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; @@ -19,10 +22,16 @@ import 'package:diplomaticquarterapp/widgets/drawer/app_drawer_widget.dart'; import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_local_notifications/flutter_local_notifications.dart'; import 'package:permission_handler/permission_handler.dart'; +import 'package:provider/provider.dart'; +import 'package:rxdart/rxdart.dart'; import 'home_page.dart'; + + + class LandingPage extends StatefulWidget { static bool isOpenCallPage = false; @@ -39,6 +48,16 @@ class _LandingPageState extends State with WidgetsBindingObserver { final FirebaseMessaging _firebaseMessaging = FirebaseMessaging(); final authService = new AuthProvider(); + void _requestIOSPermissions() { + flutterLocalNotificationsPlugin + .resolvePlatformSpecificImplementation< + IOSFlutterLocalNotificationsPlugin>() + ?.requestPermissions( + alert: true, + badge: true, + sound: true, + ); + } bool isPageNavigated = false; _changeCurrentTab(int tab) { @@ -102,6 +121,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { setState(() { AppGlobal.context = context; }); + _requestIOSPermissions(); pageController = PageController(keepPage: true); _firebaseMessaging.setAutoInitEnabled(true); @@ -119,9 +139,8 @@ class _LandingPageState extends State with WidgetsBindingObserver { print(err); }); - // TODO fix hot reload issue //_firebase Background message handler - // _firebaseMessaging.configure( + _firebaseMessaging.configure( // onMessage: (Map message) async { // showDialog("onMessage: $message"); // print("onMessage: $message"); @@ -211,17 +230,18 @@ class _LandingPageState extends State with WidgetsBindingObserver { // print(route.settings.name); // } // - // Map myMap = new Map.from(message); + // 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))) + // context, + // MaterialPageRoute( + // builder: (context) => IncomingCall( + // incomingCallData: LandingPage.incomingCallData))) // .then((value) { // isPageNavigated = false; // }); @@ -233,10 +253,12 @@ class _LandingPageState extends State with WidgetsBindingObserver { // print("Is Call Not Found iOS"); // } // }, - // ); + ); } - showDialog(String message) { + + + showDialogs(String message) { ConfirmDialog dialog = new ConfirmDialog( context: context, confirmMessage: message, @@ -254,10 +276,55 @@ class _LandingPageState extends State with WidgetsBindingObserver { Permission.camera, Permission.photos, Permission.notification, - Permission.accessMediaLocation + Permission.accessMediaLocation, + Permission.calendar, ].request(); + + var permissionsGranted = await deviceCalendarPlugin.hasPermissions(); + if (permissionsGranted.isSuccess && !permissionsGranted.data) { + permissionsGranted = await deviceCalendarPlugin.requestPermissions(); + if (!permissionsGranted.isSuccess || !permissionsGranted.data) { + return; + } + } + } + Future _scheduleNotification() async { + var scheduledNotificationDateTime = + DateTime.now().add(Duration(seconds: 5)); + var vibrationPattern = Int64List(4); + vibrationPattern[0] = 0; + vibrationPattern[1] = 1000; + vibrationPattern[2] = 5000; + vibrationPattern[3] = 2000; + + var androidPlatformChannelSpecifics = AndroidNotificationDetails( + 'your other channel id', + 'your other channel name', + 'your other channel description', + // icon: 'secondary_icon', + sound: RawResourceAndroidNotificationSound('slow_spring_board'), + largeIcon: DrawableResourceAndroidBitmap('sample_large_icon'), + vibrationPattern: vibrationPattern, + enableLights: true, + color: const Color.fromARGB(255, 255, 0, 0), + ledColor: const Color.fromARGB(255, 255, 0, 0), + ledOnMs: 1000, + ledOffMs: 500); + var iOSPlatformChannelSpecifics = + IOSNotificationDetails(sound: 'slow_spring_board.aiff'); + var platformChannelSpecifics = NotificationDetails( + androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics); + await flutterLocalNotificationsPlugin.schedule( + 0, + 'scheduled title', + 'scheduled body', + scheduledNotificationDateTime, + platformChannelSpecifics); + } + + @override Widget build(BuildContext context) { //final searchValue = Provider.of(context); diff --git a/lib/pages/login/login.dart b/lib/pages/login/login.dart index 7510987c..c1f04a71 100644 --- a/lib/pages/login/login.dart +++ b/lib/pages/login/login.dart @@ -131,6 +131,7 @@ class _Login extends State { } void validateForm() { + //TODO fix login if (util.validateIDBox(nationalIDorFile.text, loginType) == true && mobileNo.length >= 9 && util.isSAUDIIDValid(nationalIDorFile.text, loginType) == true) { @@ -139,7 +140,7 @@ class _Login extends State { }); } else { setState(() { - isButtonDisabled = true; + isButtonDisabled = false; }); } } diff --git a/lib/pages/medical/active_medications/ActiveMedicationsPage.dart b/lib/pages/medical/active_medications/ActiveMedicationsPage.dart new file mode 100644 index 00000000..5bc9618d --- /dev/null +++ b/lib/pages/medical/active_medications/ActiveMedicationsPage.dart @@ -0,0 +1,131 @@ +import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/ActiveMedicationsViewModel.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/medical/active_medications/reminder_page.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class ActiveMedicationsPage extends StatelessWidget { + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getActiveMedication(), + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + appBarTitle: TranslationBase.of(context).activeMedications, + isShowAppBar: true, + body: Container( + child: ListView.builder( + itemCount: model.activePrescriptionReport.length, + itemBuilder: (context, index) => Container( + padding: EdgeInsets.all(10), + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), color: Colors.white), + child: Row( + children: [ + Image.memory( + Utils.dataFromBase64String(model + .activePrescriptionReport[index].productImageBase64), + height: SizeConfig.imageSizeMultiplier * 19, + width: SizeConfig.imageSizeMultiplier * 18, + fit: BoxFit.cover, + ), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + model.activePrescriptionReport[index].itemDescription, + bold: true, + ), + SizedBox( + height: 5, + ), + Texts( + TranslationBase.of(context).expDate+' :' + + DateUtil.getDayMonthYearDateFormatted(model + .activePrescriptionReport[index].orderDate), + ), + SizedBox( + height: 5, + ), + Texts( + TranslationBase.of(context).route+ ' :' + + model.activePrescriptionReport[index].route, + ), + SizedBox( + height: 5, + ), + Texts( + TranslationBase.of(context).frequency+ ' :' + + model.activePrescriptionReport[index].frequency, + ), + SizedBox( + height: 5, + ), + Texts( + TranslationBase.of(context).dailyQuantity + ' :${model.activePrescriptionReport[index].doseDailyQuantity}', + ), + ], + ), + ), + Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Icon( + Icons.notifications, + color: Colors.red, + size: 28, + ), + SizedBox(height: 25,), + InkWell( + onTap: (){ + Navigator.push( + context, + FadePage( + page: ReminderPage( + frequency: model.activePrescriptionReport[index] + .frequencyNumber, + days: model.activePrescriptionReport[index].days, + itemDescription: model + .activePrescriptionReport[index] + .itemDescription, + ), + ), + ); + }, + child: Row( + children: [ + Icon( + Icons.notifications_active, + color: Colors.red, + size: 28, + ), + Texts( + TranslationBase.of(context).addReminder, + color: Colors.red, + ) + ], + ), + ) + ], + ), + ) + ], + ), + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/medical/active_medications/DayCheckBoxDialog.dart b/lib/pages/medical/active_medications/DayCheckBoxDialog.dart new file mode 100644 index 00000000..5cb4020c --- /dev/null +++ b/lib/pages/medical/active_medications/DayCheckBoxDialog.dart @@ -0,0 +1,161 @@ +import 'package:device_calendar/device_calendar.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class DayCheckBoxDialog extends StatefulWidget { + final Function(List) onValueSelected; + final String title; + final List selectedDaysOfWeek; + final List daysOfWeek = [ + DayOfWeek.Monday, + DayOfWeek.Tuesday, + DayOfWeek.Wednesday, + DayOfWeek.Thursday, + DayOfWeek.Friday, + DayOfWeek.Saturday, + DayOfWeek.Sunday, + ]; + + DayCheckBoxDialog( + {Key key, this.onValueSelected, this.selectedDaysOfWeek, this.title}); + + @override + _DayCheckBoxDialogState createState() => _DayCheckBoxDialogState(); +} + +class _DayCheckBoxDialogState extends State { + @override + Widget build(BuildContext context) { + return SimpleDialog( + title: Container( + width: double.infinity, + child: Center( + child: Texts( + widget.title, + textAlign: TextAlign.center, + ))), + children: [ + Container( + height: widget.daysOfWeek.length > 3 + ? MediaQuery.of(context).size.height * 0.6 + : null, + child: SingleChildScrollView( + child: Column( + children: [ + Divider(), + ...List.generate( + widget.daysOfWeek.length, + (index) => Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 2, + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + setState(() { + if (widget.selectedDaysOfWeek + .contains(widget.daysOfWeek[index])) + widget.selectedDaysOfWeek + .remove(widget.daysOfWeek[index]); + else + widget.selectedDaysOfWeek + .add(widget.daysOfWeek[index]); + }); + }, + child: ListTile( + title: Text(DateUtil.getDay(widget.daysOfWeek[index])), + leading: Checkbox( + value: widget.selectedDaysOfWeek + .contains(widget.daysOfWeek[index]), + onChanged: (value) { + setState(() { + if (widget.selectedDaysOfWeek + .contains(widget.daysOfWeek[index])) + widget.selectedDaysOfWeek + .remove(widget.daysOfWeek[index]); + else + widget.selectedDaysOfWeek + .add(widget.daysOfWeek[index]); + }); + }, + ), + ), + ), + ) + ], + ), + SizedBox( + height: 5.0, + ), + ], + ), + ), + SizedBox( + height: 5.0, + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + child: Center( + child: Texts( + TranslationBase.of(context) + .cancel + .toUpperCase(), + color: Colors.red, + ), + ), + ), + ), + ), + ), + Container( + width: 1, + height: 30, + color: Colors.grey[500], + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + widget.onValueSelected(widget.selectedDaysOfWeek); + 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/medical/active_medications/reminder_page.dart b/lib/pages/medical/active_medications/reminder_page.dart new file mode 100644 index 00000000..7980d941 --- /dev/null +++ b/lib/pages/medical/active_medications/reminder_page.dart @@ -0,0 +1,332 @@ +import 'package:device_calendar/device_calendar.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/ActiveMedicationsViewModel.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/CalendarUtils.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/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; +import 'package:provider/provider.dart'; + +import 'DayCheckBoxDialog.dart'; + +// ignore: must_be_immutable +class ReminderPage extends StatefulWidget { + final int frequency; + final int days; + final String itemDescription; + + List _scheduleList = List(); + List daysOfWeek = [ + DayOfWeek.Monday, + DayOfWeek.Tuesday, + DayOfWeek.Wednesday, + DayOfWeek.Thursday, + DayOfWeek.Friday, + DayOfWeek.Saturday, + DayOfWeek.Sunday + ]; + + DateTime startDay; + DateTime endDay; + + ReminderPage({Key key, this.frequency, this.days, this.itemDescription}) { + startDay = DateTime.now(); + endDay = DateTime.now().add(Duration(days: days)); + int hour = (24 ~/ frequency).round(); + int durations = 24 ~/ hour; + for (int count = 0; count < durations; count++) { + _scheduleList.add(DateTime(DateTime.now().year, DateTime.now().month, + DateTime.now().day, (hour * count))); + } + } + + @override + _ReminderPageState createState() => _ReminderPageState(); +} + +class _ReminderPageState extends State { + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + + return BaseView( + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).reminder, + body: SingleChildScrollView( + child: Container( + margin: EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: double.maxFinite, + child: Texts(TranslationBase.of(context).reminderDes), + ), + Divider(), + SizedBox( + height: 12, + ), + Texts(TranslationBase.of(context).startDay), + SizedBox( + height: 6, + ), + InkWell( + onTap: () { + DatePicker.showDatePicker(context, + showTitleActions: true, + minTime: DateTime( + DateTime.now().year, DateTime.now().month - 1, 1), + maxTime: DateTime.now(), onConfirm: (date) { + setState(() { + widget.startDay = date; + }); + }, + currentTime: widget.startDay, + locale: projectViewModel.localeType); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(getStartDay()), + Icon( + Icons.calendar_today, + color: Colors.black, + ) + ], + ), + ), + ), + SizedBox( + height: 12, + ), + Texts(TranslationBase.of(context).endDay), + SizedBox( + height: 6, + ), + InkWell( + onTap: () { + DatePicker.showDatePicker(context, + showTitleActions: true, + minTime: DateTime( + DateTime.now().year, DateTime.now().month - 1, 1), + maxTime: DateTime.now(), onConfirm: (date) { + setState(() { + widget.endDay = date; + }); + }, + currentTime: widget.endDay, + locale: projectViewModel.localeType); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(getEndDay()), + Icon( + Icons.calendar_today, + color: Colors.black, + ) + ], + ), + ), + ), + SizedBox( + height: 12, + ), + Texts(TranslationBase.of(context).days), + SizedBox( + height: 6, + ), + InkWell( + onTap: () => confirmSelectDayDialog(), + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Texts( + getDays(), + )), + Icon( + Icons.arrow_drop_down, + color: Colors.black, + ) + ], + ), + ), + ), + ...List.generate( + widget._scheduleList.length, + (index) => Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 7, + ), + Texts(TranslationBase.of(context).scheduleTime), + SizedBox( + height: 7, + ), + InkWell( + onTap: () { + DatePicker.showTimePicker(context, + showTitleActions: true, onConfirm: (date) { + setState(() { + widget._scheduleList[index] = date; + }); + }, + currentTime: widget._scheduleList[index], + locale: projectViewModel.localeType); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Texts(getDateTime( + widget._scheduleList[index])), + Icon( + Icons.access_time, + color: Colors.black, + ) + ], + ), + ), + ), + ], + )), + Container( + width: double.maxFinite, + height: MediaQuery.of(context).size.height * 0.12, + ), + ], + ), + ), + ), + bottomSheet: Container( + width: double.infinity, + height: MediaQuery.of(context).size.height * 0.2, + padding: EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SecondaryButton( + label: TranslationBase.of(context).ok, + color: Colors.grey[800], + textColor: Colors.white, + onTap: () { + schedule(); + }, + ), + SizedBox( + height: 15, + ), + SecondaryButton( + label: TranslationBase.of(context).cancel, + color: Colors.red[800], + textColor: Colors.white, + onTap: () { + Navigator.pop(context); + }, + ), + ], + ), + ), + ), + ); + } + + schedule() async { + List scheduleDateTime = + calculateDaysInterval(widget.startDay, widget.endDay); + + CalendarUtils calendarUtils = await CalendarUtils.getInstance(); + + calendarUtils.createOrUpdateEvents( + scheduleList: widget._scheduleList, + description: widget.itemDescription, + title: widget.itemDescription, + scheduleDateTime: scheduleDateTime); + + Navigator.pop(context); + } + + List calculateDaysInterval(DateTime startDate, DateTime endDate) { + List days = []; + for (int i = 0; i <= endDate.difference(startDate).inDays; i++) { + widget._scheduleList.forEach((element) { + days.add(startDate.add( + Duration(days: i, hours: element.hour, minutes: element.minute))); + }); + } + return days; + } + + String getStartDay() { + return "${DateUtil.getMonth(widget.startDay.month)} ${widget.startDay.day}, ${widget.startDay.year}"; + } + + String getEndDay() { + return "${DateUtil.getMonth(widget.endDay.month)} ${widget.endDay.day}, ${widget.endDay.year}"; + } + + String getDateTime(DateTime dateTime) { + return '${dateTime.hour}:${dateTime.minute}'; + } + + String getDays() { + String days = ""; + widget.daysOfWeek.forEach((element) { + days += "${DateUtil.getDay(element)},"; + }); + return days; + } + + void confirmSelectDayDialog() { + showDialog( + context: context, + child: DayCheckBoxDialog( + title: 'Select Day', + selectedDaysOfWeek: widget.daysOfWeek, + onValueSelected: (value) { + setState(() { + widget.daysOfWeek = value; + }); + }, + ), + ); + } +} diff --git a/lib/pages/medical/allergies_page.dart b/lib/pages/medical/allergies_page.dart new file mode 100644 index 00000000..ea063e19 --- /dev/null +++ b/lib/pages/medical/allergies_page.dart @@ -0,0 +1,54 @@ +import 'package:diplomaticquarterapp/core/viewModels/medical/AllergiesViewModel.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'; + +class AllergiesPage extends StatelessWidget { + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getAllergies(), + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).allergies, + baseViewModel: model, + body: ListView.builder( + itemCount: model.allergies.length, + itemBuilder: (context, index) => Container( + margin: EdgeInsets.all(15), + padding: EdgeInsets.all(10), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: Colors.white, + ), + child: Row( + children: [ + Image.asset( + 'assets/images/new-design/allergiesDetails.png', + width: 50, + height: 50, + fit: BoxFit.cover, + ), + SizedBox( + width: 15, + ), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts(TranslationBase.of(context).remarks+" :"), + Texts(TranslationBase.of(context).description + model.allergies[index].description ?? ''), + ], + ), + ) + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/medical/ask_doctor/ViewDoctorResponsesPage.dart b/lib/pages/medical/ask_doctor/ViewDoctorResponsesPage.dart new file mode 100644 index 00000000..fc47ed3c --- /dev/null +++ b/lib/pages/medical/ask_doctor/ViewDoctorResponsesPage.dart @@ -0,0 +1,33 @@ +import 'package:diplomaticquarterapp/core/model/ask_doctor/DoctorResponse.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/ask_doctor_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; + +class ViewDoctorResponsesPage extends StatelessWidget { + final DoctorResponse doctorResponse; + + const ViewDoctorResponsesPage({Key key, this.doctorResponse}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.updateReadStatus(transactionNo: doctorResponse.transactionNo), + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).viewDoctorResponses, + baseViewModel: model, + body: SingleChildScrollView( + child: Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [], + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/medical/ask_doctor/ask_doctor_home_page.dart b/lib/pages/medical/ask_doctor/ask_doctor_home_page.dart new file mode 100644 index 00000000..5f1938fd --- /dev/null +++ b/lib/pages/medical/ask_doctor/ask_doctor_home_page.dart @@ -0,0 +1,125 @@ +import 'dart:ui'; + +import 'package:diplomaticquarterapp/core/viewModels/medical/ask_doctor_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_history_page.dart'; +import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_page.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'ask_doctor_page.dart'; +import 'doctor_response.dart'; + +class AskDoctorHomPage extends StatefulWidget { + @override + _AskDoctorHomPageState createState() => _AskDoctorHomPageState(); +} + +class _AskDoctorHomPageState 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 AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).askDoctor, + 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.9), + ), + 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: [ + Tab( + child: Container( + width: MediaQuery.of(context).size.width * 0.36, + child: Center( + child: Texts(TranslationBase.of(context).askDoctor), + ), + ), + ), + Tab(child: Container( + width: MediaQuery.of(context).size.width * 0.36, + child: Center( + child: Texts(TranslationBase.of(context).doctorResponses,textAlign: TextAlign.start,), + ), + ),) + ], + ), + ), + ), + ), + ], + ), + ), + body: Column( + children: [ + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + AskDoctorPage(), + DoctorResponse() + ], + ), + ) + ], + ), + ), + ); + } +} diff --git a/lib/pages/medical/ask_doctor/ask_doctor_page.dart b/lib/pages/medical/ask_doctor/ask_doctor_page.dart new file mode 100644 index 00000000..6beed0dc --- /dev/null +++ b/lib/pages/medical/ask_doctor/ask_doctor_page.dart @@ -0,0 +1,240 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/ask_doctor_view_model.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/medical/ask_doctor/request_type.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.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:rating_bar/rating_bar.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; + +class AskDoctorPage extends StatelessWidget { + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getMyDoctor(), + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + body: SingleChildScrollView( + child: Container( + margin: EdgeInsets.all(10), + child: Column( + children: [ + SizedBox( + height: 70, + ), + ...List.generate( + model.patientDoctorAppointmentListHospital.length, + (index) => AppExpandableNotifier( + title: + model.patientDoctorAppointmentListHospital[index].filterName, + bodyWidget: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: + model.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList.map((doctor) { + return InkWell( + onTap: () { + model + .getCallInfoHoursResult( + doctorId: doctor.doctorID, + projectId: doctor.projectID) + .then((value) { + if (model.state != ViewState.ErrorLocal && + model.state != ViewState.Error) { + // Navigator.pop(context); + Navigator.push( + context, + FadePage( + page: RequestTypePage(doctorList: doctor,), + ), + ); + } else { + AppToast.showErrorToast(message: model.error); + } + }); + + ///.showProgressBar( + // text: "Loading", + // backgroundColor: + // Colors.blue.withOpacity(0.6)) + }, + child: Card( + margin: + EdgeInsets.fromLTRB(10.0, 16.0, 10.0, 8.0), + color: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + ), + child: Container( + decoration: BoxDecoration(), + padding: EdgeInsets.all(7.0), + width: MediaQuery.of(context).size.width, + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded( + flex: 1, + child: ClipRRect( + borderRadius: + BorderRadius.circular(100.0), + child: Image.network( + doctor.doctorImageURL, + fit: BoxFit.fill, + height: 60.0, + width: 60.0), + ), + ), + Expanded( + flex: 4, + child: Container( + width: + MediaQuery.of(context).size.width * + 0.55, + margin: EdgeInsets.fromLTRB( + 20.0, 10.0, 10.0, 0.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + if (doctor.doctorTitle != null) + Text( + doctor.doctorTitle + + " " + + doctor.name, + style: TextStyle( + fontSize: 14.0, + color: Colors.grey[700], + letterSpacing: 1.0)), + Container( + margin: EdgeInsets.only(top: 3.0), + child: Text(doctor.clinicName, + style: TextStyle( + fontSize: 12.0, + color: Colors.grey[600], + letterSpacing: 1.0)), + ), + Container( + margin: EdgeInsets.only(top: 3.0), + child: Text(doctor.projectName, + style: TextStyle( + fontSize: 12.0, + color: Colors.grey[600], + letterSpacing: 1.0)), + ), + if (doctor.speciality != null) + Container( + margin: EdgeInsets.only( + top: 3.0, bottom: 3.0), + child: Text( + getDoctorSpeciality( + doctor.speciality) + .trim(), + style: TextStyle( + fontSize: 12.0, + color: Colors.grey[600], + letterSpacing: 1.0)), + ), + doctor.nearestFreeSlot != null + ? Container( + margin: EdgeInsets.only( + top: 3.0, bottom: 3.0), + child: Text( + getDate(doctor + .nearestFreeSlot), + style: TextStyle( + fontSize: 14.0, + fontWeight: + FontWeight.bold, + color: Colors + .green[600], + letterSpacing: + 1.0)), + ) + : Container(), + Row( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + mainAxisSize: MainAxisSize.max, + children: [ + RatingBar.readOnly( + initialRating: doctor + .actualDoctorRate + .toDouble(), + size: 20.0, + filledColor: + Colors.yellow[700], + emptyColor: Colors.grey[500], + isHalfAllowed: true, + halfFilledIcon: + Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star, + ), + Container( + child: Image.network( + doctor.nationalityFlagURL, + width: 25.0, + height: 25.0), + ), + ], + ), + ], + ), + ), + ), + ], + ), + ), + ), + ); + }).toList(), + )), + ) + ], + ), + ), + ), + ), + ); + } + + String getDoctorSpeciality(List docSpecial) { + String docSpeciality = ""; + docSpecial.forEach((v) { + docSpeciality = docSpeciality + v + "\n"; + }); + return docSpeciality; + } + + String getDate(String date) { + DateTime dateObj = DateUtil.convertStringToDate(date); + return DateUtil.getWeekDay(dateObj.weekday) + + ", " + + dateObj.day.toString() + + " " + + DateUtil.getMonth(dateObj.month) + + " " + + dateObj.year.toString() + + " " + + dateObj.hour.toString() + + ":" + + getMinute(dateObj); + } + + String getMinute(DateTime dateObj) { + if (dateObj.minute == 0) { + return dateObj.minute.toString() + "0"; + } else { + return dateObj.minute.toString(); + } + } +} + diff --git a/lib/pages/medical/ask_doctor/doctor_response.dart b/lib/pages/medical/ask_doctor/doctor_response.dart new file mode 100644 index 00000000..b6071a4c --- /dev/null +++ b/lib/pages/medical/ask_doctor/doctor_response.dart @@ -0,0 +1,189 @@ +import 'package:diplomaticquarterapp/core/viewModels/medical/ask_doctor_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.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:provider/provider.dart'; + +import 'ViewDoctorResponsesPage.dart'; + +class DoctorResponse extends StatelessWidget { + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return BaseView( + onModelReady: (model) => model.getDoctorResponse(), + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + body: SingleChildScrollView( + child: Container( + margin: EdgeInsets.all(12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 65, + ), + AppExpandableNotifier( + header: Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(TranslationBase.of(context).newDes), + Container( + width: 30, + height: 30, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Colors.red[800], + ), + child: Center( + child: Texts( + '${model.doctorResponseList.length}', + color: Colors.white, + ), + ), + ) + ], + ), + ), + bodyWidget: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: model.doctorResponseList.map( + (doctor) { + return InkWell( + onTap: () { + ///go to page ViewDoctorResponsesPage + Navigator.push( + context, + FadePage( + page: ViewDoctorResponsesPage( + doctorResponse: doctor, + ), + ), + ); + }, + child: Container( + height: 70, + margin: EdgeInsets.only(top: 8, bottom: 8), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + color: Colors.white, + border: Border.all(color: Colors.grey[300]), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Expanded( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts('${doctor.doctorName}'), + SizedBox( + height: 5, + ), + Texts( + '${doctor.requestTypeDescription}'), + ], + ), + ), + ), + Icon(projectViewModel.isArabic + ? Icons.arrow_forward_ios + : Icons.arrow_back_ios) + ], + ), + ), + ); + }, + ).toList(), + ), + ), + AppExpandableNotifier( + header: Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(TranslationBase.of(context).all), + Container( + width: 30, + height: 30, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Colors.red[800], + ), + child: Center( + child: Texts( + '${model.doctorResponseList.length}', + color: Colors.white, + ), + ), + ) + ], + ), + ), + bodyWidget: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: model.doctorResponseList.map( + (doctor) { + return InkWell( + onTap: () {}, + child: Container( + height: 70, + margin: EdgeInsets.only(top: 8, bottom: 8), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + color: Colors.white, + border: Border.all(color: Colors.grey[300]), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Expanded( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts('${doctor.doctorName}'), + SizedBox( + height: 5, + ), + Texts( + '${doctor.requestTypeDescription}'), + ], + ), + ), + ), + Icon(projectViewModel.isArabic + ? Icons.arrow_forward_ios + : Icons.arrow_back_ios) + ], + ), + ), + ); + }, + ).toList(), + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/medical/ask_doctor/request_type.dart b/lib/pages/medical/ask_doctor/request_type.dart new file mode 100644 index 00000000..55e04a73 --- /dev/null +++ b/lib/pages/medical/ask_doctor/request_type.dart @@ -0,0 +1,134 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/ask_doctor_view_model.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.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:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class RequestTypePage extends StatefulWidget { + final DoctorList doctorList; + + RequestTypePage({Key key, this.doctorList}); + + @override + _RequestTypePageState createState() => _RequestTypePageState(); +} + +class _RequestTypePageState extends State { + String selected = ""; + int parameterCode = -1; + String question = ""; + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getCallRequestTypeLOVs(), + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).requestType, + baseViewModel: model, + body: SingleChildScrollView( + child: Container( + margin: EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + ...List.generate( + model.askDoctorReqTypes.length, + (index) => Container( + width: double.maxFinite, + height: 55, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8.0)), + margin: EdgeInsets.all(8.0), + child: InkWell( + onTap: () { + setState(() { + selected = model.askDoctorReqTypes[index].description; + parameterCode = + model.askDoctorReqTypes[index].parameterCode; + }); + }, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Text( + model.askDoctorReqTypes[index].description), + ), + Radio( + value: model.askDoctorReqTypes[index].description, + groupValue: selected, + activeColor: Colors.red[800], + onChanged: (value) { + setState(() { + selected = value; + parameterCode = model + .askDoctorReqTypes[index].parameterCode; + }); + }, + ), + ], + ), + ), + ), + ), + if (parameterCode == 6) + Container( + margin: EdgeInsets.only(left: 10, right: 10), + child: NewTextFields( + hintText: TranslationBase.of(context).questionHere, + minLines: 2, + maxLines: 15, + onChanged: (value) { + setState(() { + question = value; + }); + }, + ), + ), + Container( + width: double.maxFinite, + height: MediaQuery.of(context).size.height * 0.2, + ), + ], + ), + ), + ), + bottomSheet: Container( + width: double.maxFinite, + height: MediaQuery.of(context).size.height * 0.1, + child: Padding( + padding: const EdgeInsets.all(12.0), + child: SecondaryButton( + label: TranslationBase.of(context).submit, + loading: model.state == ViewState.BusyLocal, + textColor: Colors.white, + onTap: () { + model + .sendRequestLOV( + doctorList: widget.doctorList, + requestType: parameterCode.toString(), + remark: question) + .then((value) { + if (model.state != ViewState.ErrorLocal || + model.state != ViewState.Error) { + Navigator.pop(context); + } + }); + }, + color: Colors.grey[800], + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/medical/balance/dialogs/SelectPatientFamilyDialog.dart b/lib/pages/medical/balance/dialogs/SelectPatientFamilyDialog.dart index 5808aed8..bb9afd6c 100644 --- a/lib/pages/medical/balance/dialogs/SelectPatientFamilyDialog.dart +++ b/lib/pages/medical/balance/dialogs/SelectPatientFamilyDialog.dart @@ -1,5 +1,3 @@ -import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; -import 'package:diplomaticquarterapp/core/model/my_balance/patient_info.dart'; import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; diff --git a/lib/pages/medical/doctor/doctor_home_page.dart b/lib/pages/medical/doctor/doctor_home_page.dart index 7a01ef90..d406b889 100644 --- a/lib/pages/medical/doctor/doctor_home_page.dart +++ b/lib/pages/medical/doctor/doctor_home_page.dart @@ -95,35 +95,7 @@ class DoctorHomePage extends StatelessWidget { return DoctorView( doctor: doctorList, ); - /* InkWell( - onTap: () async { - model - .getDoctorProfileAndRating( - doctorId: doctor.doctorID, - clinicID: doctor.clinicID, - projectID: doctor.projectID) - .then((value) { - var asd=""; - Navigator.push( - context, - FadePage( - page: DoctorView(doctor: model.doctorList,), - ), - ); - }).catchError((e){ - var asd=""; - }); - }, - child: DoctorCard( - name: doctor.doctorName, - profileUrl: doctor.doctorImageURL, - rat: doctor.doctorRate.toDouble(), - subName: DateUtil.getMonthDayYearDateFormatted( - doctor.appointmentDate), - ), - )*/ - ; }).toList(), )), ) diff --git a/lib/pages/medical/eye/ClassesPage.dart b/lib/pages/medical/eye/ClassesPage.dart new file mode 100644 index 00000000..7904178c --- /dev/null +++ b/lib/pages/medical/eye/ClassesPage.dart @@ -0,0 +1,126 @@ +import 'package:diplomaticquarterapp/core/model/eye/AppoimentAllHistoryResult.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/EyeViewModel.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class ClassesPage extends StatelessWidget { + final ListHISGetGlassPerscription glassPerscription; + + const ClassesPage({Key key, this.glassPerscription}) : super(key: key); + + @override + Widget build(BuildContext context) { + return BaseView( + builder: (_, model, w) => AppScaffold( + body: SingleChildScrollView( + child: Container( + margin: EdgeInsets.only(top: 70, left: 15, right: 15, bottom: 15), + child: Column( + children: [ + Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.all(Radius.circular(8)), + color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts( + TranslationBase.of(context).rightEye, + fontSize: 23, + bold: true, + ), + ), + getRow(TranslationBase.of(context).sphere, '${glassPerscription.rightEyeSpherical}', '-'), + getRow(TranslationBase.of(context).cylinder, '${glassPerscription.rightEyeCylinder}', '-'), + getRow(TranslationBase.of(context).axis, '${glassPerscription.rightEyeAxis}', '-'), + getRow(TranslationBase.of(context).prism, '${glassPerscription.rightEyePrism}', '-'), + getRow(TranslationBase.of(context).va, '${glassPerscription.rightEyeVA}', '-'), + ], + ), + ), + SizedBox( + height: 17, + ), + Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.all(Radius.circular(8)), + color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts( + TranslationBase.of(context).leftEye, + fontSize: 23, + bold: true, + ), + ), + getRow(TranslationBase.of(context).sphere, '${glassPerscription.leftEyeSpherical}', '-'), + getRow(TranslationBase.of(context).cylinder, '${glassPerscription.leftEyeCylinder}', '-'), + getRow(TranslationBase.of(context).axis, '${glassPerscription.leftEyeAxis}', '-'), + getRow(TranslationBase.of(context).prism, '${glassPerscription.leftEyePrism}', '-'), + getRow(TranslationBase.of(context).va, '${glassPerscription.leftEyeVA}', '-'), + ], + ), + ), + SizedBox( + height: 17, + ), + Container( + width: double.infinity, + child: SecondaryButton( + label: TranslationBase.of(context).sendEmail, + textColor: Colors.white, + color: Colors.red[700], + icon: Icon( + Icons.email, + color: Colors.white, + ), + ), + ) + ], + ), + ), + ), + ), + ); + } + + Widget getRow(String title, String val1, String val2) => Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded(flex: 4, child: Texts(title)), + Expanded( + flex: 2, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Texts(val1 == 'null' ? '-' : val1), + Texts(val2 != 'null' ? '-' :val2), + ], + ), + ) + ], + ), + Divider() + ], + ), + ); +} diff --git a/lib/pages/medical/eye/ContactLensPage.dart b/lib/pages/medical/eye/ContactLensPage.dart new file mode 100644 index 00000000..26503c89 --- /dev/null +++ b/lib/pages/medical/eye/ContactLensPage.dart @@ -0,0 +1,129 @@ +import 'package:diplomaticquarterapp/core/model/eye/AppoimentAllHistoryResult.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class ContactLensPage extends StatelessWidget { + final ListHISGetContactLensPerscription listHISGetContactLensPerscription; + + const ContactLensPage({Key key, this.listHISGetContactLensPerscription}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return AppScaffold( + body: SingleChildScrollView( + child: Container( + margin: EdgeInsets.only(top: 70, left: 15, right: 15, bottom: 15), + child: Column( + children: [ + Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.all(Radius.circular(8)), + color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts( + TranslationBase.of(context).rightEye, + fontSize: 23, + bold: true, + ), + ), + getRow(TranslationBase.of(context).brand, '${listHISGetContactLensPerscription.brand}'), + getRow('B.C', '${listHISGetContactLensPerscription.baseCurve}'), + getRow(TranslationBase.of(context).power, '${listHISGetContactLensPerscription.power}'), + getRow(TranslationBase.of(context).diameter, '${listHISGetContactLensPerscription.diameter}'), + getRow('OZ', '${listHISGetContactLensPerscription.oZ}'), + getRow('CT', '${listHISGetContactLensPerscription.cT}'), + getRow('Blend', '${listHISGetContactLensPerscription.blend}'), + getRow(TranslationBase.of(context).reminder, '${listHISGetContactLensPerscription.remarks}'), + + + ], + ), + ), + SizedBox( + height: 17, + ), + Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.all(Radius.circular(8)), + color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts( + TranslationBase.of(context).leftEye, + fontSize: 23, + bold: true, + ), + ), + getRow(TranslationBase.of(context).brand, '${listHISGetContactLensPerscription.brand}'), + getRow('B.C', '${listHISGetContactLensPerscription.baseCurve}'), + getRow(TranslationBase.of(context).power, '${listHISGetContactLensPerscription.power}'), + getRow(TranslationBase.of(context).diameter, '${listHISGetContactLensPerscription.diameter}'), + getRow('OZ', '${listHISGetContactLensPerscription.oZ}'), + getRow('CT', '${listHISGetContactLensPerscription.cT}'), + getRow('Blend', '${listHISGetContactLensPerscription.blend}'), + getRow(TranslationBase.of(context).reminder, '${listHISGetContactLensPerscription.remarks}'), + ], + ), + ), + SizedBox( + height: 17, + ), + Container( + width: double.infinity, + child: SecondaryButton( + label: TranslationBase.of(context).sendEmail, + textColor: Colors.white, + color: Colors.red[700], + icon: Icon( + Icons.email, + color: Colors.white, + ), + ), + ) + ], + ), + ), + ), + ); + } + + Widget getRow(String title, String val1) => Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Expanded(flex: 4, child: Texts(title)), + Expanded( + flex: 2, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts(val1 == 'null' ? '-' : val1), + ], + ), + ) + ], + ), + Divider() + ], + ), + ); +} diff --git a/lib/pages/medical/eye/EyeHomePage.dart b/lib/pages/medical/eye/EyeHomePage.dart new file mode 100644 index 00000000..18cc9b77 --- /dev/null +++ b/lib/pages/medical/eye/EyeHomePage.dart @@ -0,0 +1,128 @@ +import 'dart:ui'; + +import 'package:diplomaticquarterapp/core/model/eye/AppoimentAllHistoryResult.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/EyeViewModel.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/weight_pressure_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 'ClassesPage.dart'; +import 'ContactLensPage.dart'; + +class EyeHomePage extends StatefulWidget { + final AppoimentAllHistoryResultList appointmentAllHistoryResultList; + + const EyeHomePage({Key key, this.appointmentAllHistoryResultList}) + : super(key: key); + + @override + _EyeHomePageState createState() => _EyeHomePageState(); +} + +class _EyeHomePageState 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 AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).measurements, + body: Scaffold( + extendBodyBehindAppBar: true, + appBar: PreferredSize( + preferredSize: Size.fromHeight(60.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: 55.0, + margin: EdgeInsets.only(left: 20,right: 20,top: 15), + 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: 5.0, right: 5.0), + unselectedLabelColor: Colors.grey[800], + tabs: [ + Container( + width: MediaQuery.of(context).size.width * 0.27, + child: Center( + child: Texts(TranslationBase.of(context).classes), + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.27, + child: Center( + child: Texts(TranslationBase.of(context).contactLens), + ), + ), + ], + ), + ), + ), + ), + ], + ), + ), + body: Column( + children: [ + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + ClassesPage( + glassPerscription: widget.appointmentAllHistoryResultList + .listHISGetGlassPerscription[0], + ), + ContactLensPage( + listHISGetContactLensPerscription: widget + .appointmentAllHistoryResultList + .listHISGetContactLensPerscription[0], + ) + ], + ), + ) + ], + ), + ), + ); + } +} diff --git a/lib/pages/medical/eye/EyeMeasurementsPage.dart b/lib/pages/medical/eye/EyeMeasurementsPage.dart new file mode 100644 index 00000000..8dbe0f16 --- /dev/null +++ b/lib/pages/medical/eye/EyeMeasurementsPage.dart @@ -0,0 +1,123 @@ +import 'package:diplomaticquarterapp/core/viewModels/medical/EyeViewModel.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/StarRating.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.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:provider/provider.dart'; + +import 'EyeHomePage.dart'; + +class EyeMeasurementsPage extends StatelessWidget { + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return BaseView( + onModelReady: (model) => model.getEyeMeasurement(), + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + baseViewModel: model, + appBarTitle: TranslationBase.of(context).eyeMeasurements, + body: SingleChildScrollView( + child: Container( + margin: EdgeInsets.all(8), + child: Column( + children: [ + ...List.generate( + model.appointmentFilter.length, + (index) => AppExpandableNotifier( + title: model.appointmentFilter[index].filterName, + bodyWidget: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: model.appointmentFilter[index] + .appointmentAllHistoryResultList + .map((appointment) { + return InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: EyeHomePage( + appointmentAllHistoryResultList: appointment, + ), + ), + ); + }, + child: Container( + margin: EdgeInsets.all(8), + padding: EdgeInsets.all(8.0), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + color: Colors.white, + border: Border.all(color: Colors.grey), + ), + child: Row( + children: [ + Expanded( + flex: 1, + child: LargeAvatar( + name: appointment.doctorNameObj, + url: appointment.doctorImageURL, + ), + ), + Expanded( + flex: 4, + child: Container( + margin: EdgeInsets.all(10), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + appointment.doctorNameObj, + bold: true, + ), + Texts( + appointment.clinicName, + variant: 'caption3', + ), + Texts( + DateUtil.getMonthDayYearDateFormatted( + appointment.bookDate), + variant: 'caption3', + ), + StarRating( + totalAverage: appointment + .actualDoctorRate + .toDouble(), + forceStars: true), + ], + ), + ), + ), + Icon( + projectViewModel.isArabic + ? Icons.arrow_forward_ios + : Icons.arrow_back_ios, + color: Colors.grey, + size: 18, + ) + ], + ), + ), + ); + }).toList(), + ), + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/medical/medical_profile_page.dart b/lib/pages/medical/medical_profile_page.dart index 79c5571d..d2b9a9ea 100644 --- a/lib/pages/medical/medical_profile_page.dart +++ b/lib/pages/medical/medical_profile_page.dart @@ -24,11 +24,17 @@ import 'package:flutter/material.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_card_screen.dart'; import 'package:provider/provider.dart'; import '../../locator.dart'; +import 'active_medications/ActiveMedicationsPage.dart'; +import 'allergies_page.dart'; +import 'ask_doctor/ask_doctor_home_page.dart'; import 'balance/my_balance_page.dart'; import 'doctor/doctor_home_page.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_approval_screen.dart'; +import 'eye/EyeHomePage.dart'; +import 'eye/EyeMeasurementsPage.dart'; import 'labs/labs_home_page.dart'; +import 'my_trackers/my_trackers.dart'; class MedicalProfilePage extends StatefulWidget { @override @@ -174,7 +180,7 @@ class _MedicalProfilePageState extends State { child: MedicalProfileItem( title: TranslationBase.of(context) .vitalSigns, - imagePath: 'medical_history_icon.png', + imagePath: 'vital_signs.png', subTitle: TranslationBase.of(context) .vitalSignsSubtitle, ), @@ -183,12 +189,12 @@ class _MedicalProfilePageState extends State { Expanded( flex: 1, child: InkWell( -// onTap: () => Navigator.push( -// context, FadePage(page: RadiologyHomePage())), + onTap: () => Navigator.push(context, + FadePage(page: ActiveMedicationsPage())), child: MedicalProfileItem( title: TranslationBase.of(context) .myMedical, - imagePath: 'radiology_icon.png', + imagePath: 'active_medications.png', subTitle: TranslationBase.of(context) .myMedicalSubtitle, ), @@ -221,15 +227,15 @@ class _MedicalProfilePageState extends State { Expanded( flex: 1, child: InkWell( - //TODO -// onTap: () { -// Navigator.push(context, -// FadePage(page: InsuranceApproval())); -// }, + onTap: () { + Navigator.push( + context, + FadePage( + page: EyeMeasurementsPage())); + }, child: MedicalProfileItem( title: TranslationBase.of(context).eye, - imagePath: - 'insurance_approvals_icon.png', + imagePath: 'eye_measurement_icon.png', subTitle: TranslationBase.of(context) .eyeSubtitle, ), @@ -264,7 +270,7 @@ class _MedicalProfilePageState extends State { child: MedicalProfileItem( title: TranslationBase.of(context) .updateInsurance, - imagePath: 'insurance_card_icon.png', + imagePath: 'insurance_update_icon_.png', subTitle: TranslationBase.of(context) .updateInsuranceSubtitle, ), @@ -288,12 +294,14 @@ class _MedicalProfilePageState extends State { ), Expanded( flex: 1, - child: MedicalProfileItem( - title: - TranslationBase.of(context).allergies, - imagePath: 'medical_history_icon.png', - subTitle: TranslationBase.of(context) - .allergiesSubtitle, + child: InkWell( + onTap:()=> Navigator.push(context, FadePage(page: AllergiesPage())) , + child: MedicalProfileItem( + title: TranslationBase.of(context).allergies, + imagePath: 'my_allergies_icon.png', + subTitle: TranslationBase.of(context) + .allergiesSubtitle, + ), ), ), ]), @@ -308,7 +316,7 @@ class _MedicalProfilePageState extends State { child: MedicalProfileItem( title: TranslationBase.of(context) .myVaccines, - imagePath: 'insurance_card_icon.png', + imagePath: 'my_vaccines_icon.png', subTitle: TranslationBase.of(context) .myVaccinesSubtitle, ), @@ -324,7 +332,7 @@ class _MedicalProfilePageState extends State { child: MedicalProfileItem( title: TranslationBase.of(context).medical, - imagePath: 'insurance_approvals_icon.png', + imagePath: 'medical_reports_icon.png', subTitle: TranslationBase.of(context) .medicalSubtitle, ), @@ -340,7 +348,7 @@ class _MedicalProfilePageState extends State { child: MedicalProfileItem( title: TranslationBase.of(context).monthly, - imagePath: 'medical_history_icon.png', + imagePath: 'monthly_reports_icon.png', subTitle: TranslationBase.of(context) .monthlySubtitle, ), @@ -351,7 +359,6 @@ class _MedicalProfilePageState extends State { Expanded( flex: 1, child: InkWell( - //TODO onTap: () { Navigator.push( context, @@ -360,7 +367,7 @@ class _MedicalProfilePageState extends State { }, child: MedicalProfileItem( title: TranslationBase.of(context).sick, - imagePath: 'insurance_card_icon.png', + imagePath: 'sick_leaves_icons.png', subTitle: TranslationBase.of(context) .sickSubtitle, ), @@ -376,7 +383,7 @@ class _MedicalProfilePageState extends State { child: MedicalProfileItem( title: TranslationBase.of(context).myBalance, - imagePath: 'insurance_approvals_icon.png', + imagePath: 'check-in.png', subTitle: TranslationBase.of(context) .myBalanceSubtitle, ), @@ -405,7 +412,7 @@ class _MedicalProfilePageState extends State { child: MedicalProfileItem( title: TranslationBase.of(context) .smartWatches, - imagePath: 'insurance_card_icon.png', + imagePath: 'smartwatch_icon.png', subTitle: TranslationBase.of(context) .smartWatchesSubtitle, ), @@ -414,14 +421,14 @@ class _MedicalProfilePageState extends State { Expanded( flex: 1, child: InkWell( -// onTap: () { -// Navigator.push( -// context, FadePage(page: InsuranceApproval())); -// }, + onTap: () { + Navigator.push(context, + FadePage(page: MyTrackers())); + }, child: MedicalProfileItem( title: TranslationBase.of(context) .myTrackers, - imagePath: 'insurance_approvals_icon.png', + imagePath: 'my_tracker_icon.png', subTitle: TranslationBase.of(context) .myTrackersSubtitle, ), @@ -429,11 +436,17 @@ class _MedicalProfilePageState extends State { ), Expanded( flex: 1, - child: MedicalProfileItem( - title: TranslationBase.of(context).askYour, - imagePath: 'medical_history_icon.png', - subTitle: TranslationBase.of(context) - .askYourSubtitle, + child: InkWell( + onTap: (){ + Navigator.push(context, + FadePage(page: AskDoctorHomPage())); + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).askYour, + imagePath: 'ask_doctor_icon.png', + subTitle: TranslationBase.of(context) + .askYourSubtitle, + ), ), ), ]), diff --git a/lib/pages/medical/my_trackers/Weight/AddWeightPage.dart b/lib/pages/medical/my_trackers/Weight/AddWeightPage.dart new file mode 100644 index 00000000..a7b23191 --- /dev/null +++ b/lib/pages/medical/my_trackers/Weight/AddWeightPage.dart @@ -0,0 +1,204 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/blood_pressure_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/blood_sugar_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/weight_pressure_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.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/dialogs/RadioStringDialog.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:feather_icons_flutter/feather_icons_flutter.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; +import 'package:provider/provider.dart'; + +class AddWeightPage extends StatefulWidget { + @override + _AddWeightPageState createState() => _AddWeightPageState(); +} + +class _AddWeightPageState extends State { + TextEditingController _weightValueController = TextEditingController(); + DateTime bloodSugarDate = DateTime.now(); + DateTime timeSugarDate = DateTime.now(); + int weightUnit = 1; + final List measureUnitEnList = [ + 'Kg', + 'Pound', + ]; + final List measureUnitArList = [ + 'Kg', + 'Pound', + ]; + String measureTimeSelectedType = 'Kg'; + + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + + return BaseView( + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + appBarTitle: 'Add', + body: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Container( + margin: EdgeInsets.all(15), + child: Column( + children: [ + SizedBox( + height: 15, + ), + NewTextFields( + hintText: 'Enter Weight Value', + controller: _weightValueController, + keyboardType: TextInputType.number, + ), + SizedBox( + height: 8, + ), + InkWell( + onTap: () { + confirmSelectMeasureTimeDialog(projectViewModel.isArabic + ? measureUnitEnList + : measureUnitArList); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(measureTimeSelectedType), + Icon( + Icons.arrow_drop_down, + color: Colors.grey, + ) + ], + ), + ), + ), + SizedBox( + height: 8, + ), + InkWell( + onTap: () { + DatePicker.showDatePicker(context, + showTitleActions: true, + minTime: DateTime(DateTime.now().year - 1, 1, 1), + maxTime: DateTime.now(), onConfirm: (date) { + print('confirm $date'); + setState(() { + bloodSugarDate = date; + }); + }, + currentTime: bloodSugarDate, + locale: projectViewModel.localeType); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts('Date'), + Texts(getDate()), + ], + ), + ), + ), + SizedBox( + height: 8, + ), + InkWell( + onTap: () { + DatePicker.showTimePicker(context, showTitleActions: true, + onConfirm: (date) { + print('confirm $date'); + setState(() { + timeSugarDate = date; + }); + }, + currentTime: timeSugarDate, + locale: projectViewModel.localeType); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [Texts('Time'), Texts(getTime())], + ), + ), + ), + ], + ), + ), + ), + bottomSheet: Container( + color: Colors.transparent, + width: double.infinity, + height: MediaQuery.of(context).size.width * 0.2, + child: Padding( + padding: const EdgeInsets.all(15.0), + child: SecondaryButton( + loading: model.state == ViewState.BusyLocal, + label: 'SAVE', + textColor: Colors.white, + onTap: () { + if (_weightValueController.text.isNotEmpty ) { + model.addWeightResult( + weightDate: '${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00', + weightMeasured: _weightValueController.text.toString(), + weightUnit: weightUnit, + ); + } + }), + ), + ), + ), + ); + } + + String getDate() { + return "${DateUtil.getMonth(bloodSugarDate.month)} ${bloodSugarDate.day}, ${bloodSugarDate.year}"; + } + + String getTime() { + return " ${timeSugarDate.hour}:${timeSugarDate.minute}"; + } + + void confirmSelectMeasureTimeDialog(List list) { + showDialog( + context: context, + child: RadioStringDialog( + radioList: list, + title: 'Measure unit', + selectedValue: measureTimeSelectedType, + onValueSelected: (value) { + setState(() { + measureTimeSelectedType = value; + weightUnit = list.indexOf(value); + }); + }, + ), + ); + } +} diff --git a/lib/pages/medical/my_trackers/Weight/WeightHomePage.dart b/lib/pages/medical/my_trackers/Weight/WeightHomePage.dart new file mode 100644 index 00000000..7d7c5dd5 --- /dev/null +++ b/lib/pages/medical/my_trackers/Weight/WeightHomePage.dart @@ -0,0 +1,151 @@ +import 'dart:ui'; +import 'package:diplomaticquarterapp/core/viewModels/medical/weight_pressure_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; +import 'AddWeightPage.dart'; +import 'WeightMonthlyPage.dart'; +import 'WeightYeaPage.dart'; +import 'WeightWeeklyPage.dart'; + +class WeightHomePage extends StatefulWidget { + @override + _WeightHomePageState createState() => _WeightHomePageState(); +} + +class _WeightHomePageState extends State + with SingleTickerProviderStateMixin { + TabController _tabController; + + @override + void initState() { + super.initState(); + _tabController = TabController(length: 3, vsync: this); + } + + @override + void dispose() { + super.dispose(); + _tabController.dispose(); + } + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getWeight(), + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + appBarTitle: 'Weight', + baseViewModel: model, + body: Scaffold( + extendBodyBehindAppBar: true, + appBar: PreferredSize( + preferredSize: Size.fromHeight(60.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: 55.0, + 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: 5.0, right: 5.0), + unselectedLabelColor: Colors.grey[800], + tabs: [ + Container( + width: MediaQuery.of(context).size.width * 0.27, + child: Center( + child: Texts('Weekly'), + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.27, + child: Center( + child: Texts('Monthly'), + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.27, + child: Center( + child: Texts('Yearly'), + ), + ), + ], + ), + ), + ), + ), + ], + ), + ), + body: Column( + children: [ + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + WeightWeeklyPage( + data: model.getWeightWeeklySeries(), + diabtecPatientResult: model.weekWeightMeasurementResult, + ), + WeightMonthlyPage( + data: model.getWeightMonthlyTimeSeriesSales(), + diabtecPatientResult: model.monthWeightMeasurementResult, + ), + WeightYearPage( + data: model.getWeightYearTimeSeriesSales(), + diabtecPatientResult: model.yearWeightMeasurementResult, + ) + ], + ), + ) + ], + ), + floatingActionButton: InkWell( + onTap: () { + Navigator.push(context, FadePage(page: AddWeightPage())); + }, + child: Container( + width: 55, + height: 55, + decoration: BoxDecoration( + shape: BoxShape.circle, color: Hexcolor('515B5D')), + child: Center( + child: Icon( + Icons.add, + color: Colors.white, + ), + ), + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/medical/my_trackers/Weight/WeightMonthlyPage.dart b/lib/pages/medical/my_trackers/Weight/WeightMonthlyPage.dart new file mode 100644 index 00000000..5bdbfeab --- /dev/null +++ b/lib/pages/medical/my_trackers/Weight/WeightMonthlyPage.dart @@ -0,0 +1,155 @@ +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_pressur/BloodPressureResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/YearMonthlyChartDate.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/weight/WeightMeasurementResult.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.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:charts_flutter/flutter.dart' as charts; +import 'package:hexcolor/hexcolor.dart'; + +class WeightMonthlyPage extends StatelessWidget { + final List> data; + final List diabtecPatientResult; + + const WeightMonthlyPage( + {Key key, this.data, this.diabtecPatientResult}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return AppScaffold( + body: ListView( + children: [ + Container( + width: double.maxFinite, + height: 180, + color: Colors.white, + child: charts.LineChart(data, + //animate: animate, + defaultRenderer: + new charts.LineRendererConfig(includePoints: true)), + ), + SizedBox( + height: 12, + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts('Details'), + ), + Container( + padding: EdgeInsets.all(10), + color: Colors.transparent, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Table( + border: TableBorder.symmetric( + inside: BorderSide(width: 2.0, color: Colors.grey[300]), + ), + children: fullData(), + ), + ], + ), + ) + ], + ), + ); + } + + List fullData() { + List tableRow = []; + tableRow.add( + TableRow( + children: [ + Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts( + 'Date', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40, + ), + Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + ), + child: Center( + child: Texts('Time', color: Colors.white,fontSize: 15,), + ), + height: 40), + Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + ), + child: Center( + child: Texts('Value', color: Colors.white,fontSize: 15,), + ), + height: 40), + ], + ), + ); + diabtecPatientResult.forEach( + (diabtec) { + tableRow.add( + TableRow( + children: [ + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${DateUtil.getMonthDayYearDateFormatted(diabtec.weightDate)} ', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.weightDate.hour}:${diabtec.weightDate.minute}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.weightMeasured}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + ], + ), + ); + }, + ); + return tableRow; + } +} diff --git a/lib/pages/medical/my_trackers/Weight/WeightWeeklyPage.dart b/lib/pages/medical/my_trackers/Weight/WeightWeeklyPage.dart new file mode 100644 index 00000000..ac1a3214 --- /dev/null +++ b/lib/pages/medical/my_trackers/Weight/WeightWeeklyPage.dart @@ -0,0 +1,170 @@ +import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/weight/WeightMeasurementResult.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.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:charts_flutter/flutter.dart' as charts; +import 'package:hexcolor/hexcolor.dart'; + +class WeightWeeklyPage extends StatelessWidget { + final List> data; + final List diabtecPatientResult; + + const WeightWeeklyPage({Key key, this.data, this.diabtecPatientResult}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return AppScaffold( + body: ListView( + children: [ + Container( + width: double.maxFinite, + height: 180, + color: Colors.white, + child: charts.TimeSeriesChart( + data, + dateTimeFactory: const charts.LocalDateTimeFactory(), + ), + ), + SizedBox(height: 12,), + + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts('Details'), + ), + Container( + padding: EdgeInsets.all(10), + color: Colors.transparent, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Table( + border: TableBorder.symmetric( + inside: BorderSide(width: 2.0, color: Colors.grey[300]), + ), + children: fullData(), + ), + ], + ), + ) + ], + ), + ); + } + + List fullData() { + List tableRow = []; + tableRow.add( + TableRow( + children: [ + Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts( + 'Date', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40, + ), + Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + ), + child: Center( + child: Texts('Time', color: Colors.white,fontSize: 15,), + ), + height: 40), + Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + ), + child: Center( + child: Texts('Value', color: Colors.white,fontSize: 15,), + ), + height: 40), + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + borderRadius: BorderRadius.only( + topRight: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts('Edit', color: Colors.white,fontSize: 15,), + ), + height: 40), + ), + ], + ), + ); + diabtecPatientResult.forEach((diabtec) { + tableRow.add( + TableRow( + children: [ + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${DateUtil.getMonthDayYearDateFormatted(diabtec.weightDate)} ', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.weightDate.hour}:${diabtec.weightDate.minute}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.weightMeasured}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Icon(Icons.edit), + ), + ), + ], + ), + ); + }, + ); + return tableRow; + } +} diff --git a/lib/pages/medical/my_trackers/Weight/WeightYeaPage.dart b/lib/pages/medical/my_trackers/Weight/WeightYeaPage.dart new file mode 100644 index 00000000..3ddeaa82 --- /dev/null +++ b/lib/pages/medical/my_trackers/Weight/WeightYeaPage.dart @@ -0,0 +1,153 @@ +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_pressur/BloodPressureResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/weight/WeightMeasurementResult.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.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:charts_flutter/flutter.dart' as charts; +import 'package:hexcolor/hexcolor.dart'; + +class WeightYearPage extends StatelessWidget { + final List> data; + final List diabtecPatientResult; + + const WeightYearPage({Key key, this.data, this.diabtecPatientResult}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return AppScaffold( + body: ListView( + children: [ + Container( + width: double.maxFinite, + height: 180, + color: Colors.white, + child: charts.TimeSeriesChart( + data, + dateTimeFactory: const charts.LocalDateTimeFactory(), + ), + ), + SizedBox( + height: 12, + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts('Details'), + ), + Container( + padding: EdgeInsets.all(10), + color: Colors.transparent, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Table( + border: TableBorder.symmetric( + inside: BorderSide(width: 2.0, color: Colors.grey[300]), + ), + children: fullData(), + ), + ], + ), + ) + ], + ), + ); + } + + List fullData() { + List tableRow = []; + tableRow.add( + TableRow( + children: [ + Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts( + 'Date', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40, + ), + Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + ), + child: Center( + child: Texts('Time', color: Colors.white,fontSize: 15,), + ), + height: 40), + Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + ), + child: Center( + child: Texts('Value', color: Colors.white,fontSize: 15,), + ), + height: 40), + ], + ), + ); + diabtecPatientResult.forEach( + (diabtec) { + tableRow.add( + TableRow( + children: [ + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${DateUtil.getMonthDayYearDateFormatted(diabtec.weightDate)} ', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.weightDate.hour}:${diabtec.weightDate.minute}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.weightMeasured}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + ], + ), + ); + }, + ); + return tableRow; + } +} diff --git a/lib/pages/medical/my_trackers/blood_pressure/AddBloodPressurePage.dart b/lib/pages/medical/my_trackers/blood_pressure/AddBloodPressurePage.dart new file mode 100644 index 00000000..b8d9a557 --- /dev/null +++ b/lib/pages/medical/my_trackers/blood_pressure/AddBloodPressurePage.dart @@ -0,0 +1,215 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/blood_pressure_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/blood_sugar_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.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/dialogs/RadioStringDialog.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:feather_icons_flutter/feather_icons_flutter.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; +import 'package:provider/provider.dart'; + +class AddBloodPressurePage extends StatefulWidget { + @override + _AddBloodPressurePageState createState() => _AddBloodPressurePageState(); +} + +class _AddBloodPressurePageState extends State { + TextEditingController _bloodSystolicValueController = TextEditingController(); + TextEditingController _bloodDiastolicValueController = + TextEditingController(); + DateTime bloodSugarDate = DateTime.now(); + DateTime timeSugarDate = DateTime.now(); + int measuredArm = 1; + final List measureTimeEnList = [ + 'Left Arm', + 'Right Arm', + ]; + final List measureTimeArList = [ + 'الذراع الأيسر', + 'الذراع الأيمن', + ]; + String measureTimeSelectedType = 'Left Arm'; + + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + + return BaseView( + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + appBarTitle: 'Add', + body: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Container( + margin: EdgeInsets.all(15), + child: Column( + children: [ + SizedBox( + height: 15, + ), + NewTextFields( + hintText: 'Enter Systolic Value', + controller: _bloodSystolicValueController, + keyboardType: TextInputType.number, + ), + SizedBox( + height: 8, + ), + NewTextFields( + hintText: 'Blood Diastolic Value', + controller: _bloodDiastolicValueController, + keyboardType: TextInputType.number, + ), + SizedBox( + height: 8, + ), + InkWell( + onTap: () { + confirmSelectMeasureTimeDialog(projectViewModel.isArabic + ? measureTimeEnList + : measureTimeArList); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(measureTimeSelectedType), + Icon( + Icons.arrow_drop_down, + color: Colors.grey, + ) + ], + ), + ), + ), + SizedBox( + height: 8, + ), + InkWell( + onTap: () { + DatePicker.showDatePicker(context, + showTitleActions: true, + minTime: DateTime(DateTime.now().year - 1, 1, 1), + maxTime: DateTime.now(), onConfirm: (date) { + print('confirm $date'); + setState(() { + bloodSugarDate = date; + }); + }, + currentTime: bloodSugarDate, + locale: projectViewModel.localeType); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts('Date'), + Texts(getDate()), + ], + ), + ), + ), + SizedBox( + height: 8, + ), + InkWell( + onTap: () { + DatePicker.showTimePicker(context, showTitleActions: true, + onConfirm: (date) { + print('confirm $date'); + setState(() { + timeSugarDate = date; + }); + }, + currentTime: timeSugarDate, + locale: projectViewModel.localeType); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [Texts('Time'), Texts(getTime())], + ), + ), + ), + ], + ), + ), + ), + bottomSheet: Container( + color: Colors.transparent, + width: double.infinity, + height: MediaQuery.of(context).size.width * 0.2, + child: Padding( + padding: const EdgeInsets.all(15.0), + child: SecondaryButton( + loading: model.state == ViewState.BusyLocal, + label: 'SAVE', + textColor: Colors.white, + onTap: () { + if (_bloodSystolicValueController.text.isNotEmpty && + _bloodDiastolicValueController.text.isNotEmpty) { + model.addDiabtecResult( + bloodPressureDate: '${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00', + diastolicPressure: _bloodDiastolicValueController.text.toString(), + systolicePressure: _bloodSystolicValueController.text.toString(), + measuredArm: measuredArm, + ); + } + }), + ), + ), + ), + ); + } + + String getDate() { + return "${DateUtil.getMonth(bloodSugarDate.month)} ${bloodSugarDate.day}, ${bloodSugarDate.year}"; + } + + String getTime() { + return " ${timeSugarDate.hour}:${timeSugarDate.minute}"; + } + + void confirmSelectMeasureTimeDialog(List list) { + showDialog( + context: context, + child: RadioStringDialog( + radioList: list, + title: 'Select the Arm', + selectedValue: measureTimeSelectedType, + onValueSelected: (value) { + setState(() { + measureTimeSelectedType = value; + measuredArm = list.indexOf(value); + }); + }, + ), + ); + } +} diff --git a/lib/pages/medical/my_trackers/blood_pressure/BloodPressureHomePage.dart b/lib/pages/medical/my_trackers/blood_pressure/BloodPressureHomePage.dart new file mode 100644 index 00000000..c118f2ca --- /dev/null +++ b/lib/pages/medical/my_trackers/blood_pressure/BloodPressureHomePage.dart @@ -0,0 +1,154 @@ +import 'dart:ui'; + +import 'package:diplomaticquarterapp/core/viewModels/medical/blood_pressure_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/blood_sugar_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; + +import 'AddBloodPressurePage.dart'; +import 'BloodPressureMonthly.dart'; +import 'BloodPressureYeaPage.dart'; +import 'bloodPressureWeeklyPage.dart'; + +class BloodPressureHomePage extends StatefulWidget { + @override + _BloodPressureHomePageState createState() => _BloodPressureHomePageState(); +} + +class _BloodPressureHomePageState extends State + with SingleTickerProviderStateMixin { + TabController _tabController; + + @override + void initState() { + super.initState(); + _tabController = TabController(length: 3, vsync: this); + } + + @override + void dispose() { + super.dispose(); + _tabController.dispose(); + } + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getBloodPressure(), + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + appBarTitle: 'Blood Pressure', + baseViewModel: model, + body: Scaffold( + extendBodyBehindAppBar: true, + appBar: PreferredSize( + preferredSize: Size.fromHeight(60.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: 55.0, + 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: 5.0, right: 5.0), + unselectedLabelColor: Colors.grey[800], + tabs: [ + Container( + width: MediaQuery.of(context).size.width * 0.27, + child: Center( + child: Texts('Weekly'), + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.27, + child: Center( + child: Texts('Monthly'), + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.27, + child: Center( + child: Texts('Yearly'), + ), + ), + ], + ), + ), + ), + ), + ], + ), + ), + body: Column( + children: [ + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + BloodPressureWeeklyPage( + data: model.getBloodWeeklySeries(), + diabtecPatientResult: model.weekDiabtecPatientResult, + ), + BloodPressureMonthlyPage( + data: model.getBloodMonthlyTimeSeriesSales(), + diabtecPatientResult: model.monthDiabtecPatientResult, + ), + BloodPressureYearPage( + data: model.getBloodYearTimeSeriesSales(), + diabtecPatientResult: model.yearDiabtecPatientResult, + ) + ], + ), + ) + ], + ), + floatingActionButton: InkWell( + onTap: () { + Navigator.push(context, FadePage(page: AddBloodPressurePage())); + }, + child: Container( + width: 55, + height: 55, + decoration: BoxDecoration( + shape: BoxShape.circle, color: Hexcolor('515B5D')), + child: Center( + child: Icon( + Icons.add, + color: Colors.white, + ), + ), + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/medical/my_trackers/blood_pressure/BloodPressureMonthly.dart b/lib/pages/medical/my_trackers/blood_pressure/BloodPressureMonthly.dart new file mode 100644 index 00000000..f38cc3b6 --- /dev/null +++ b/lib/pages/medical/my_trackers/blood_pressure/BloodPressureMonthly.dart @@ -0,0 +1,200 @@ +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_pressur/BloodPressureResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/YearMonthlyChartDate.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.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:charts_flutter/flutter.dart' as charts; +import 'package:hexcolor/hexcolor.dart'; + +class BloodPressureMonthlyPage extends StatelessWidget { + final List> data; + final List diabtecPatientResult; + + const BloodPressureMonthlyPage( + {Key key, this.data, this.diabtecPatientResult}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return AppScaffold( + body: ListView( + children: [ + Container( + width: double.maxFinite, + height: 180, + color: Colors.white, + child: charts.LineChart(data, + //animate: animate, + defaultRenderer: + new charts.LineRendererConfig(includePoints: true)), + ), + SizedBox( + height: 12, + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts('Details'), + ), + Container( + padding: EdgeInsets.all(10), + color: Colors.transparent, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Table( + border: TableBorder.symmetric( + inside: BorderSide(width: 2.0, color: Colors.grey[300]), + ), + children: fullData(), + ), + ], + ), + ) + ], + ), + ); + } + + List fullData() { + List tableRow = []; + tableRow.add( + TableRow( + children: [ + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts( + 'Date', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40, + ), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + ), + child: Center( + child: Texts( + 'Time', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + ), + child: Center( + child: Texts( + 'Measured', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + borderRadius: BorderRadius.only( + topRight: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts( + 'Value', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40), + ), + ], + ), + ); + diabtecPatientResult.forEach( + (diabtec) { + tableRow.add( + TableRow( + children: [ + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${DateUtil.getMonthDayYearDateFormatted(diabtec.bloodPressureDate)} ', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + Container(child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.bloodPressureDate.hour}:${diabtec.bloodPressureDate.minute}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ),), + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.measuredArmDesc}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.systolicePressure}/${diabtec.diastolicPressure}', + textAlign: TextAlign.center, + fontSize: 12, + color: Colors.red, + ), + ), + ), + ), + ], + ), + ); + }, + ); + return tableRow; + } +} diff --git a/lib/pages/medical/my_trackers/blood_pressure/BloodPressureYeaPage.dart b/lib/pages/medical/my_trackers/blood_pressure/BloodPressureYeaPage.dart new file mode 100644 index 00000000..dfcf42ae --- /dev/null +++ b/lib/pages/medical/my_trackers/blood_pressure/BloodPressureYeaPage.dart @@ -0,0 +1,199 @@ +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_pressur/BloodPressureResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.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:charts_flutter/flutter.dart' as charts; +import 'package:hexcolor/hexcolor.dart'; + +class BloodPressureYearPage extends StatelessWidget { + final List> data; + final List diabtecPatientResult; + + const BloodPressureYearPage({Key key, this.data, this.diabtecPatientResult}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return AppScaffold( + body: ListView( + children: [ + Container( + width: double.maxFinite, + height: 180, + color: Colors.white, + child: charts.TimeSeriesChart( + data, + dateTimeFactory: const charts.LocalDateTimeFactory(), + ), + ), + SizedBox( + height: 12, + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts('Details'), + ), + Container( + padding: EdgeInsets.all(10), + color: Colors.transparent, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Table( + border: TableBorder.symmetric( + inside: BorderSide(width: 2.0, color: Colors.grey[300]), + ), + children: fullData(), + ), + ], + ), + ) + ], + ), + ); + } + + List fullData() { + List tableRow = []; + tableRow.add( + TableRow( + children: [ + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts( + 'Date', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40, + ), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + ), + child: Center( + child: Texts( + 'Time', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + ), + child: Center( + child: Texts( + 'Measured', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40), + ), + + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + borderRadius: BorderRadius.only( + topRight: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts( + 'Value', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40), + ), + ], + ), + ); + diabtecPatientResult.forEach( + (diabtec) { + tableRow.add( + TableRow( + children: [ + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${DateUtil.getMonthDayYearDateFormatted(diabtec.bloodPressureDate)} ', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.bloodPressureDate.hour}:${diabtec.bloodPressureDate.minute}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.measuredArmDesc}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.systolicePressure}/${diabtec.diastolicPressure}', + textAlign: TextAlign.center, + fontSize: 12, + color: Colors.red, + ), + ), + ), + ), + ], + ), + ); + }, + ); + return tableRow; + } +} diff --git a/lib/pages/medical/my_trackers/blood_pressure/bloodPressureWeeklyPage.dart b/lib/pages/medical/my_trackers/blood_pressure/bloodPressureWeeklyPage.dart new file mode 100644 index 00000000..fbcbf417 --- /dev/null +++ b/lib/pages/medical/my_trackers/blood_pressure/bloodPressureWeeklyPage.dart @@ -0,0 +1,204 @@ +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_pressur/BloodPressureResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.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:charts_flutter/flutter.dart' as charts; +import 'package:hexcolor/hexcolor.dart'; + +class BloodPressureWeeklyPage extends StatelessWidget { + final List> data; + final List diabtecPatientResult; + + const BloodPressureWeeklyPage({Key key, this.data, this.diabtecPatientResult}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return AppScaffold( + body: ListView( + children: [ + Container( + width: double.maxFinite, + height: 180, + color: Colors.white, + child: charts.TimeSeriesChart( + data, + dateTimeFactory: const charts.LocalDateTimeFactory(), + ), + ), + SizedBox(height: 12,), + + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts('Details'), + ), + Container( + padding: EdgeInsets.all(10), + color: Colors.transparent, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Table( + border: TableBorder.symmetric( + inside: BorderSide(width: 2.0, color: Colors.grey[300]), + ), + children: fullData(), + ), + ], + ), + ) + ], + ), + ); + } + + List fullData() { + List tableRow = []; + tableRow.add( + TableRow( + children: [ + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts( + 'Date', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40, + ), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + ), + child: Center( + child: Texts('Time', color: Colors.white,fontSize: 15,), + ), + height: 40), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + ), + child: Center( + child: Texts('Measured', color: Colors.white,fontSize: 15,), + ), + height: 40), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + ), + child: Center( + child: Texts('Value', color: Colors.white,fontSize: 15,), + ), + height: 40), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + borderRadius: BorderRadius.only( + topRight: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts('Edit', color: Colors.white,fontSize: 15,), + ), + height: 40), + ), + ], + ), + ); + diabtecPatientResult.forEach((diabtec) { + tableRow.add( + TableRow( + children: [ + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${DateUtil.getMonthDayYearDateFormatted(diabtec.bloodPressureDate)} ', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.bloodPressureDate.hour}:${diabtec.bloodPressureDate.minute}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.measuredArmDesc}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.systolicePressure}/${diabtec.diastolicPressure}', + textAlign: TextAlign.center, + fontSize: 12, + color: Colors.red, + ), + ), + ), + ), + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Icon(Icons.edit), + ), + ), + ), + ], + ), + ); + }, + ); + return tableRow; + } +} diff --git a/lib/pages/medical/my_trackers/blood_suger/AddBloodSugarPage.dart b/lib/pages/medical/my_trackers/blood_suger/AddBloodSugarPage.dart new file mode 100644 index 00000000..00f06a25 --- /dev/null +++ b/lib/pages/medical/my_trackers/blood_suger/AddBloodSugarPage.dart @@ -0,0 +1,344 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/blood_sugar_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.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/dialogs/RadioStringDialog.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:feather_icons_flutter/feather_icons_flutter.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; +import 'package:provider/provider.dart'; + +class AddBloodSugarPage extends StatefulWidget { + @override + _AddBloodSugarPageState createState() => _AddBloodSugarPageState(); +} + +class _AddBloodSugarPageState extends State { + TextEditingController _bloodSugarValueController = TextEditingController(); + DateTime bloodSugarDate = DateTime.now(); + DateTime timeSugarDate = DateTime.now(); + String measureUnitSelectedType = 'mg/dlt'; + int measuredTime=1; + final List measureUnitList = ['mg/dlt', 'mol/L']; + final List measureTimeEnList = [ + 'Before Breakfast', + 'After Breakfast', + 'Before Lunch', + 'After Lunch', + 'Before Dinner', + 'After Dinner', + 'Before Sleep', + 'After Sleep', + 'Fasting', + 'Other', + ]; + final List measureTimeArList = [ + 'Before Breakfast', + 'After Breakfast', + 'Before Lunch', + 'After Lunch', + 'Before Dinner', + 'After Dinner', + 'Before Sleep', + 'After Sleep', + 'Fasting', + 'Other', + ]; + String measureTimeSelectedType; + + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + showTaskOptions() { + showModalBottomSheet( + backgroundColor: Colors.white, + context: context, + builder: (BuildContext bc) { + return Container( + padding: EdgeInsets.symmetric(vertical: 12.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(16.0), + topRight: Radius.circular(16.0))), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Container( + decoration: BoxDecoration( + color: Colors.grey[200], + borderRadius: BorderRadius.circular(3.0)), + width: 40.0, + height: 6.0, + ), + InkWell( + onTap: () { + Navigator.pop(context); + }, + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: 18.0, vertical: 18.0), + child: Row( + children: [ + Icon( + FeatherIcons.share, + color: Theme + .of(context) + .primaryColor, + size: 18.0, + ), + SizedBox(width: 24.0), + Texts('Share Task', + variant: "body2Link", color: Colors.grey[800]), + ], + ), + ), + ), + InkWell( + onTap: () { + Navigator.pop(context); + // Navigator.of(context).push(SlideUpPageRoute(widget: PostTaskIndex(task: new Task(category: task?.category, description: task?.description, title: task?.title)))); + }, + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: 18.0, vertical: 18.0), + child: Row( + children: [ + Icon( + FeatherIcons.copy, + color: Theme + .of(context) + .primaryColor, + size: 18.0, + ), + SizedBox(width: 24.0), + Texts('Post Similar Task', + variant: "body2Link", color: Colors.grey[800]), + ], + ), + ), + ), + ], + ), + ); + }); + } + + return BaseView( + builder: (_, model, w) => + AppScaffold( + isShowAppBar: true, + appBarTitle: 'Add', + body: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Container( + margin: EdgeInsets.all(15), + child: Column( + children: [ + SizedBox( + height: 15, + ), + NewTextFields( + hintText: 'Enter Blood Sugar Value', + controller: _bloodSugarValueController, + keyboardType: TextInputType.number, + ), + SizedBox( + height: 8, + ), + InkWell( + onTap: () { + confirmSelectMeasureUnitDialog(); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(measureUnitSelectedType), + Icon( + Icons.arrow_drop_down, + color: Colors.grey, + ) + ], + ), + ), + ), + SizedBox( + height: 8, + ), + InkWell( + onTap: () { + DatePicker.showDatePicker(context, + showTitleActions: true, + minTime: DateTime(DateTime + .now() + .year - 1, 1, 1), + maxTime: DateTime.now(), + onConfirm: (date) { + print('confirm $date'); + setState(() { + bloodSugarDate = date; + }); + }, + currentTime: bloodSugarDate, + locale: projectViewModel.localeType); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts('Date'), + Texts(getDate()), + ], + ), + ), + ), + SizedBox( + height: 8, + ), + InkWell( + onTap: () { + DatePicker.showTimePicker( + context, showTitleActions: true, + onConfirm: (date) { + print('confirm $date'); + setState(() { + timeSugarDate = date; + }); + }, + currentTime: timeSugarDate, + locale: projectViewModel.localeType); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [Texts('Time'), Texts(getTime())], + ), + ), + ), + SizedBox( + height: 8, + ), + InkWell( + onTap: () { + confirmSelectMeasureTimeDialog(projectViewModel.isArabic + ? measureTimeEnList + : measureTimeArList); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(measureTimeSelectedType ?? 'Others'), + Icon( + Icons.arrow_drop_down, + color: Colors.grey, + ) + ], + ), + ), + ), + ], + ), + ), + ), + bottomSheet: Container( + color: Colors.transparent, + width: double.infinity, + height: MediaQuery + .of(context) + .size + .width * 0.2, + child: Padding( + padding: const EdgeInsets.all(15.0), + child: SecondaryButton( + loading: model.state == ViewState.BusyLocal, + label: 'SAVE', textColor: Colors.white, onTap: () { + if (_bloodSugarValueController.text.isNotEmpty) { + model.addDiabtecResult(diabtecUnit: measureUnitSelectedType, + measuredTime: measuredTime, + bloodSugerResult:_bloodSugarValueController.text.toString(), + bloodSugerDateChart: '${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00', + + ); + } + }), + ), + ), + ), + ); + } + + String getDate() { + return "${DateUtil.getMonth(bloodSugarDate.month)} ${bloodSugarDate + .day}, ${bloodSugarDate.year}"; + } + + String getTime() { + return " ${timeSugarDate.hour}:${timeSugarDate.minute}"; + } + + void confirmSelectMeasureUnitDialog() { + showDialog( + context: context, + child: RadioStringDialog( + radioList: measureUnitList, + title: 'Measure unit', + selectedValue: measureUnitSelectedType, + onValueSelected: (value) { + setState(() { + measureUnitSelectedType = value; + }); + }, + ), + ); + } + + void confirmSelectMeasureTimeDialog(List list) { + showDialog( + context: context, + child: RadioStringDialog( + radioList: list, + title: 'Measure time', + selectedValue: measureTimeSelectedType, + onValueSelected: (value) { + setState(() { + measureTimeSelectedType = value; + measuredTime = list.indexOf(value); + }); + }, + ), + ); + } +} diff --git a/lib/pages/medical/my_trackers/blood_suger/BloodMonthly.dart b/lib/pages/medical/my_trackers/blood_suger/BloodMonthly.dart new file mode 100644 index 00000000..da31c4ed --- /dev/null +++ b/lib/pages/medical/my_trackers/blood_suger/BloodMonthly.dart @@ -0,0 +1,188 @@ + +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/YearMonthlyChartDate.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.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:charts_flutter/flutter.dart' as charts; +import 'package:hexcolor/hexcolor.dart'; + +class BloodMonthlyPage extends StatelessWidget { + final List> data; + final List diabtecPatientResult; + + const BloodMonthlyPage({Key key, this.data,this.diabtecPatientResult}) : super(key: key); + @override + Widget build(BuildContext context) { + return AppScaffold( + body: ListView( + children: [ + Container( + width: double.maxFinite, + height: 180, + color: Colors.white, + child: charts.LineChart( + data, + //animate: animate, + defaultRenderer: new charts.LineRendererConfig(includePoints: true) + ), + ), + SizedBox(height: 12,), + + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts('Details'), + ), + Container( + padding: EdgeInsets.all(10), + color: Colors.transparent, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Table( + border: TableBorder.symmetric( + inside: BorderSide(width: 2.0, color: Colors.grey[300]), + ), + children: fullData(), + ), + ], + ), + ) + + ], + ), + ); + } + + List fullData() { + List tableRow = []; + tableRow.add( + TableRow( + children: [ + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts( + 'Date', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40, + ), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + ), + child: Center( + child: Texts('Time', color: Colors.white,fontSize: 15,), + ), + height: 40), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + ), + child: Center( + child: Texts('Measured', color: Colors.white,fontSize: 15,), + ), + height: 40), + ), + + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + borderRadius: BorderRadius.only( + topRight: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts('Value', color: Colors.white,fontSize: 15,), + ), + height: 40), + ), + ], + ), + ); + diabtecPatientResult.forEach((diabtec) { + tableRow.add( + TableRow( + children: [ + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${DateUtil.getMonthDayYearDateFormatted(diabtec.dateChart)} ', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.dateChart.hour}:${diabtec.dateChart.minute}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.measuredDesc}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.resultValue}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + + ], + ), + ); + }, + ); + return tableRow; + } +} diff --git a/lib/pages/medical/my_trackers/blood_suger/BloodYeaPage.dart b/lib/pages/medical/my_trackers/blood_suger/BloodYeaPage.dart new file mode 100644 index 00000000..3bddab88 --- /dev/null +++ b/lib/pages/medical/my_trackers/blood_suger/BloodYeaPage.dart @@ -0,0 +1,199 @@ +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.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:charts_flutter/flutter.dart' as charts; +import 'package:hexcolor/hexcolor.dart'; + +class BloodYearPage extends StatelessWidget { + final List> data; + final List diabtecPatientResult; + + const BloodYearPage({Key key, this.data, this.diabtecPatientResult}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return AppScaffold( + body: ListView( + children: [ + Container( + width: double.maxFinite, + height: 180, + color: Colors.white, + child: charts.TimeSeriesChart( + data, + dateTimeFactory: const charts.LocalDateTimeFactory(), + ), + ), + SizedBox( + height: 12, + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts('Details'), + ), + Container( + padding: EdgeInsets.all(10), + color: Colors.transparent, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Table( + border: TableBorder.symmetric( + inside: BorderSide(width: 2.0, color: Colors.grey[300]), + ), + children: fullData(), + ), + ], + ), + ) + ], + ), + ); + } + + List fullData() { + List tableRow = []; + tableRow.add( + TableRow( + children: [ + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts( + 'Date', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40, + ), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + ), + child: Center( + child: Texts( + 'Time', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + ), + child: Center( + child: Texts( + 'Measured', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40), + ), + + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + borderRadius: BorderRadius.only( + topRight: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts( + 'Value', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40), + ), + ], + ), + ); + diabtecPatientResult.forEach( + (diabtec) { + tableRow.add( + TableRow( + children: [ + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${DateUtil.getMonthDayYearDateFormatted(diabtec.dateChart)} ', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.dateChart.hour}:${diabtec.dateChart.minute}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.measuredDesc}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.resultValue}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + ], + ), + ); + }, + ); + return tableRow; + } +} diff --git a/lib/pages/medical/my_trackers/blood_suger/blood_sugar_home_page.dart b/lib/pages/medical/my_trackers/blood_suger/blood_sugar_home_page.dart new file mode 100644 index 00000000..1190b6b6 --- /dev/null +++ b/lib/pages/medical/my_trackers/blood_suger/blood_sugar_home_page.dart @@ -0,0 +1,145 @@ +import 'dart:ui'; + +import 'package:diplomaticquarterapp/core/viewModels/medical/blood_sugar_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:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:charts_flutter/flutter.dart' as charts; +import 'package:hexcolor/hexcolor.dart'; + +import 'AddBloodSugarPage.dart'; +import 'BloodMonthly.dart'; +import 'BloodYeaPage.dart'; +import 'blood_sugar_weekly_page.dart'; + +class BloodSugarHomePage extends StatefulWidget { + @override + _BloodSugarHomePageState createState() => _BloodSugarHomePageState(); +} + +class _BloodSugarHomePageState extends State + with SingleTickerProviderStateMixin { + TabController _tabController; + + @override + void initState() { + super.initState(); + _tabController = TabController(length: 3, vsync: this); + } + + @override + void dispose() { + super.dispose(); + _tabController.dispose(); + } + + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getBloodSugar(), + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + appBarTitle: 'Blood Sugar', + baseViewModel: model, + body: Scaffold( + extendBodyBehindAppBar: true, + appBar: PreferredSize( + preferredSize: Size.fromHeight(60.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: 55.0, + 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: 5.0, right: 5.0), + unselectedLabelColor: Colors.grey[800], + tabs: [ + Container( + width: MediaQuery.of(context).size.width * 0.27, + child: Center( + child: Texts('Weekly'), + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.27, + child: Center( + child: Texts('Monthly'), + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.27, + child: Center( + child: Texts('Yearly'), + ), + ), + ], + ), + ), + ), + ), + ], + ), + ), + body: Column( + children: [ + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + BloodSugarWeeklyPage(data: model.getBloodWeeklySeries(),diabtecPatientResult: model.weekDiabtecPatientResult,), + BloodMonthlyPage(data: model.getBloodMonthlyTimeSeriesSales(),diabtecPatientResult: model.monthDiabtecPatientResult,), + BloodYearPage(data: model.getBloodYearTimeSeriesSales(),diabtecPatientResult: model.yearDiabtecPatientResult,) + ], + ), + ) + ], + ), + floatingActionButton: InkWell( + onTap: (){ + Navigator.push(context, FadePage(page: AddBloodSugarPage())); + }, + child: Container( + width: 55, + height: 55, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Hexcolor('515B5D') + ), + child: Center( + child: Icon(Icons.add,color: Colors.white,), + ), + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/medical/my_trackers/blood_suger/blood_sugar_weekly_page.dart b/lib/pages/medical/my_trackers/blood_suger/blood_sugar_weekly_page.dart new file mode 100644 index 00000000..6b892162 --- /dev/null +++ b/lib/pages/medical/my_trackers/blood_suger/blood_sugar_weekly_page.dart @@ -0,0 +1,204 @@ +import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; +import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.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:charts_flutter/flutter.dart' as charts; +import 'package:hexcolor/hexcolor.dart'; + +class BloodSugarWeeklyPage extends StatelessWidget { + final List> data; + final List diabtecPatientResult; + + const BloodSugarWeeklyPage({Key key, this.data, this.diabtecPatientResult}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return AppScaffold( + body: ListView( + children: [ + Container( + width: double.maxFinite, + height: 180, + color: Colors.white, + child: charts.TimeSeriesChart( + data, + dateTimeFactory: const charts.LocalDateTimeFactory(), + ), + ), + SizedBox(height: 12,), + + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts('Details'), + ), + Container( + padding: EdgeInsets.all(10), + color: Colors.transparent, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Table( + border: TableBorder.symmetric( + inside: BorderSide(width: 2.0, color: Colors.grey[300]), + ), + children: fullData(), + ), + ], + ), + ) + ], + ), + ); + } + + List fullData() { + List tableRow = []; + tableRow.add( + TableRow( + children: [ + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts( + 'Date', + color: Colors.white, + fontSize: 15, + ), + ), + height: 40, + ), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + ), + child: Center( + child: Texts('Time', color: Colors.white,fontSize: 15,), + ), + height: 40), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + ), + child: Center( + child: Texts('Measured', color: Colors.white,fontSize: 15,), + ), + height: 40), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + ), + child: Center( + child: Texts('Value', color: Colors.white,fontSize: 15,), + ), + height: 40), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + borderRadius: BorderRadius.only( + topRight: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts('Edit', color: Colors.white,fontSize: 15,), + ), + height: 40), + ), + ], + ), + ); + diabtecPatientResult.forEach((diabtec) { + tableRow.add( + TableRow( + children: [ + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${DateUtil.getMonthDayYearDateFormatted(diabtec.dateChart)}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.dateChart.hour}:${diabtec.dateChart.minute}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.measuredDesc}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.resultValue}', + textAlign: TextAlign.center, + fontSize: 12, + ), + ), + ), + ), + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Icon(Icons.edit), + ), + ), + ), + ], + ), + ); + }, + ); + return tableRow; + } +} diff --git a/lib/pages/medical/my_trackers/my_trackers.dart b/lib/pages/medical/my_trackers/my_trackers.dart new file mode 100644 index 00000000..ecdf5a53 --- /dev/null +++ b/lib/pages/medical/my_trackers/my_trackers.dart @@ -0,0 +1,114 @@ +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 'Weight/WeightHomePage.dart'; +import 'blood_pressure/BloodPressureHomePage.dart'; +import 'blood_suger/blood_sugar_home_page.dart'; + +class MyTrackers extends StatelessWidget { + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: 'My Tracker', + isShowAppBar: true, + body: SingleChildScrollView( + child: Container( + padding: EdgeInsets.all(12), + margin: EdgeInsets.all(12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: InkWell( + onTap: ()=> Navigator.push(context, FadePage(page: BloodSugarHomePage())), + child: Container( + margin: EdgeInsets.all(5), + width: MediaQuery.of(context).size.width*0.35, + height:MediaQuery.of(context).size.width*0.35 , + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + color: Colors.white + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.asset('assets/tracker/blood-suger.png',width: 60.0,), + SizedBox(height: 15,), + Text('Blood Sugar'), + ], + ), + ), + ), + ), + Expanded( + child: InkWell( + onTap: ()=> Navigator.push(context, FadePage(page: BloodPressureHomePage())), + child: Container( + margin: EdgeInsets.all(5), + width: MediaQuery.of(context).size.width*0.35, + height:MediaQuery.of(context).size.width*0.35 , + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + color: Colors.white + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.asset('assets/tracker/blood-pressure.png',width: 60.0,), + SizedBox(height: 15,), + Text('Blood Pressure'), + ], + ), + ), + ), + ), + ], + ), + Row( + //mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Expanded( + child: InkWell( + onTap: ()=> Navigator.push(context, FadePage(page: WeightHomePage())), + child: Container( + margin: EdgeInsets.all(5), + width: MediaQuery.of(context).size.width*0.35, + height:MediaQuery.of(context).size.width*0.35 , + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + color: Colors.white + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.asset('assets/tracker/weight.png',width: 60.0,), + SizedBox(height: 15,), + Text('Weight'), + ], + ), + ), + ), + ), + Expanded( + child: Container(), + ), + ], + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/pages/medical/prescriptions/prescriptions_home_page.dart b/lib/pages/medical/prescriptions/prescriptions_home_page.dart index e6e3e6db..182fca30 100644 --- a/lib/pages/medical/prescriptions/prescriptions_home_page.dart +++ b/lib/pages/medical/prescriptions/prescriptions_home_page.dart @@ -37,7 +37,7 @@ class _HomePrescriptionsPageState extends State onModelReady: (model) => model.getPrescriptions(), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, - appBarTitle: TranslationBase.of(context).myDoctor, + appBarTitle: TranslationBase.of(context).prescriptions, body: Scaffold( extendBodyBehindAppBar: true, appBar: PreferredSize( diff --git a/lib/uitl/CalendarUtils.dart b/lib/uitl/CalendarUtils.dart new file mode 100644 index 00000000..546d9b2d --- /dev/null +++ b/lib/uitl/CalendarUtils.dart @@ -0,0 +1,79 @@ +import 'dart:async'; +import 'dart:ui'; + +import 'package:device_calendar/device_calendar.dart'; + +final DeviceCalendarPlugin deviceCalendarPlugin = DeviceCalendarPlugin(); + +class CalendarUtils { + static Completer _completer; + + Calendar get writableCalendars => calendars?.firstWhere((c) => !c.isReadOnly); + List calendars; + + CalendarUtils._(this.calendars); + + static Future getInstance() async { + if (_completer == null) { + _completer = Completer(); + try { + final calendarsResult = await deviceCalendarPlugin.retrieveCalendars(); + _completer.complete(CalendarUtils._(calendarsResult?.data)); + } on Exception catch (e) { + _completer.completeError(e); + final Future sharedPrefsFuture = _completer.future; + _completer = null; + return sharedPrefsFuture; + } + } + return _completer.future; + } + + Future createOrUpdateEvents( + {List scheduleList, + String title, + String description, + List scheduleDateTime, + List daysOfWeek}) async { + List events = List(); + scheduleDateTime.forEach((element) { + RecurrenceRule recurrenceRule = RecurrenceRule( + RecurrenceFrequency.Daily, + daysOfWeek: daysOfWeek, + endDate: element, + ); + Event event = Event(writableCalendars.id, + recurrenceRule: recurrenceRule, + start: element, + end: element.add(Duration(minutes: 30)), + title: title, + description: description); + events.add(event); + }); + + events.forEach((element) { + deviceCalendarPlugin.createOrUpdateEvent(element); + }); + } + + deleteEvent(Calendar _calendar, Event _event) async { + await deviceCalendarPlugin.deleteEvent(_calendar.id, _event.eventId); + } + + Future retrieveEvents( + String calendarId, + RetrieveEventsParams retrieveEventsParams, + ) async { + return await deviceCalendarPlugin.retrieveEvents( + calendarId, retrieveEventsParams); + } + + Future createCalendar( + String calendarName, { + Color calendarColor, + String localAccountName, + }) async { + return await deviceCalendarPlugin.createCalendar(calendarName, + calendarColor: calendarColor, localAccountName: localAccountName); + } +} diff --git a/lib/uitl/LocalNotification.dart b/lib/uitl/LocalNotification.dart new file mode 100644 index 00000000..ac4f5860 --- /dev/null +++ b/lib/uitl/LocalNotification.dart @@ -0,0 +1,97 @@ +import 'dart:typed_data'; +import 'dart:ui'; + +import 'package:flutter/cupertino.dart'; +import 'package:flutter_local_notifications/flutter_local_notifications.dart'; + +final FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin = FlutterLocalNotificationsPlugin(); + +class LocalNotification { + + + static Future scheduleNotification( + {@required DateTime scheduledNotificationDateTime, + @required String title, + @required String description}) async { + + ///vibrationPattern + var vibrationPattern = Int64List(4); + vibrationPattern[0] = 0; + vibrationPattern[1] = 1000; + vibrationPattern[2] = 5000; + vibrationPattern[3] = 2000; + + var androidPlatformChannelSpecifics = AndroidNotificationDetails( + 'active-prescriptions', + 'ActivePrescriptions', + 'ActivePrescriptionsDescription', + // icon: 'secondary_icon', + sound: RawResourceAndroidNotificationSound('slow_spring_board'),///change it to be as ionic + // largeIcon: DrawableResourceAndroidBitmap('sample_large_icon'),///change it to be as ionic + vibrationPattern: vibrationPattern, + enableLights: true, + color: const Color.fromARGB(255, 255, 0, 0), + ledColor: const Color.fromARGB(255, 255, 0, 0), + ledOnMs: 1000, + ledOffMs: 500); + var iOSPlatformChannelSpecifics = + IOSNotificationDetails(sound: 'slow_spring_board.aiff');///change it to be as ionic + var platformChannelSpecifics = NotificationDetails( + androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics); + await flutterLocalNotificationsPlugin.schedule( + 0, + title, + description, + scheduledNotificationDateTime, + platformChannelSpecifics); + } + + ///Repeat notification every day at approximately 10:00:00 am + static Future showDailyAtTime() async { + var time = Time(10, 0, 0); + var androidPlatformChannelSpecifics = AndroidNotificationDetails( + 'repeatDailyAtTime channel id', + 'repeatDailyAtTime channel name', + 'repeatDailyAtTime description'); + var iOSPlatformChannelSpecifics = IOSNotificationDetails(); + var platformChannelSpecifics = NotificationDetails( + androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics); + await flutterLocalNotificationsPlugin.showDailyAtTime( + 0, + 'show daily title', + 'Daily notification shown at approximately ${_toTwoDigitString(time.hour)}:${_toTwoDigitString(time.minute)}:${_toTwoDigitString(time.second)}', + time, + platformChannelSpecifics); + } + + ///Repeat notification weekly on Monday at approximately 10:00:00 am + static Future showWeeklyAtDayAndTime() async { + var time = Time(10, 0, 0); + var androidPlatformChannelSpecifics = AndroidNotificationDetails( + 'show weekly channel id', + 'show weekly channel name', + 'show weekly description'); + var iOSPlatformChannelSpecifics = IOSNotificationDetails(); + var platformChannelSpecifics = NotificationDetails( + androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics); + await flutterLocalNotificationsPlugin.showWeeklyAtDayAndTime( + 0, + 'show weekly title', + 'Weekly notification shown on Monday at approximately ${_toTwoDigitString(time.hour)}:${_toTwoDigitString(time.minute)}:${_toTwoDigitString(time.second)}', + Day.Monday, + time, + platformChannelSpecifics); + } + + static String _toTwoDigitString(int value) { + return value.toString().padLeft(2, '0'); + } + + static Future cancelNotification() async { + await flutterLocalNotificationsPlugin.cancel(0); + } + + static Future cancelAllNotifications() async { + await flutterLocalNotificationsPlugin.cancelAll(); + } +} diff --git a/lib/uitl/date_uitl.dart b/lib/uitl/date_uitl.dart index 834cb0fe..0155ff10 100644 --- a/lib/uitl/date_uitl.dart +++ b/lib/uitl/date_uitl.dart @@ -1,3 +1,4 @@ +import 'package:device_calendar/device_calendar.dart'; import 'package:intl/intl.dart'; class DateUtil { @@ -26,6 +27,16 @@ class DateUtil { return start + "$milliseconds" + end; } + static String yearMonthDay(DateTime dateTime) { + String dateFormat = '${dateTime.year}-${dateTime.month}-${dateTime.day}'; + return dateFormat; + } + + static String time(DateTime dateTime) { + String dateFormat = '${dateTime.hour}:${dateTime.minute}:00'; + return dateFormat; + } + /// check Date /// [dateString] String we want to convert static String checkDate(DateTime checkedTime) { @@ -67,30 +78,69 @@ class DateUtil { static getMonth(int month) { switch (month) { case 1: - return "Jan"; + return "January"; case 2: - return "Feb"; + return "February"; case 3: - return "Mar"; + return "March"; case 4: - return "Apr"; + return "April"; case 5: return "May"; case 6: - return "Jun"; + return "June"; case 7: - return "Jul"; + return "July"; case 8: - return "Aug"; + return "August"; case 9: - return "Sep"; + return "September"; case 10: - return "Oct"; + return "October"; case 11: - return "Nov"; + return "November"; case 12: - return "Dec"; + return "December"; + } + } + + static getMonthByName(String month) { + switch (month.toLowerCase()) { + case 'january': + return 1; + case 'february': + return 2; + case 'march': + return 3; + case 'april': + return 4; + case 'may': + return 5; + case 'june': + return 6; + case 'july': + return 7; + case 'august': + return 8; + case 'september': + return 9; + case 'october': + return 10; + case 'november': + return 11; + case 'december': + return 12; + } + } + + static getMonthDateTime(String month, yearName) { + DateTime date; + try { + date = DateTime(int.parse(yearName), getMonthByName(month)); + } catch (e) { + print(e); } + return date ?? DateTime.now(); } /// get month by @@ -184,4 +234,31 @@ class DateUtil { .toString() + ")/"; } + + static String getDay(DayOfWeek dayOfWeek) { + switch (dayOfWeek) { + case DayOfWeek.Monday: + return "Monday"; + break; + case DayOfWeek.Tuesday: + return "Tuesday"; + break; + case DayOfWeek.Wednesday: + return "Wednesday"; + break; + case DayOfWeek.Thursday: + return "Thursday"; + break; + case DayOfWeek.Friday: + return "Friday"; + break; + case DayOfWeek.Saturday: + return "Saturday"; + 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 ba89fc2c..28b273e5 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -557,6 +557,38 @@ class TranslationBase { String get ok => localizedValues['Ok'][locale.languageCode]; String get theVerificationCodeExpiresIn => localizedValues['TheVerificationCodeExpiresIn'][locale.languageCode]; String get pleaseEnterTheVerificationCode => localizedValues['PleaseEnterTheVerificationCode'][locale.languageCode]; + String get eyeMeasurements => localizedValues['EyeMeasurements'][locale.languageCode]; + String get measurements => localizedValues['Measurements'][locale.languageCode]; + String get classes => localizedValues['Classes'][locale.languageCode]; + String get contactLens => localizedValues['ContactLens'][locale.languageCode]; + String get rightEye => localizedValues['RightEye'][locale.languageCode]; + String get sphere => localizedValues['Sphere'][locale.languageCode]; + String get cylinder => localizedValues['Cylinder'][locale.languageCode]; + String get axis => localizedValues['Axis'][locale.languageCode]; + String get prism => localizedValues['Prism'][locale.languageCode]; + String get va => localizedValues['VA'][locale.languageCode]; + String get leftEye => localizedValues['LeftEye'][locale.languageCode]; + String get brand => localizedValues['Brand'][locale.languageCode]; + String get power => localizedValues['Power'][locale.languageCode]; + String get diameter => localizedValues['Diameter'][locale.languageCode]; + String get remarks => localizedValues['Remarks'][locale.languageCode]; + String get activeMedications => localizedValues['ActiveMedications'][locale.languageCode]; + String get expDate => localizedValues['ExpDate'][locale.languageCode]; + String get route => localizedValues['Route'][locale.languageCode]; + String get frequency => localizedValues['Frequency'][locale.languageCode]; + String get dailyQuantity => localizedValues['DailyQuantity'][locale.languageCode]; + String get addReminder => localizedValues['AddReminder'][locale.languageCode]; + String get reminderDes => localizedValues['reminderDes'][locale.languageCode]; + String get startDay => localizedValues['StartDay'][locale.languageCode]; + String get endDay => localizedValues['EndDay'][locale.languageCode]; + String get days => localizedValues['Days'][locale.languageCode]; + String get scheduleTime => localizedValues['ScheduleTime'][locale.languageCode]; + String get askDoctor => localizedValues['AskDoctor'][locale.languageCode]; + String get doctorResponses => localizedValues['DoctorResponses'][locale.languageCode]; + String get newDes => localizedValues['New'][locale.languageCode]; + String get all => localizedValues['All'][locale.languageCode]; + String get questionHere => localizedValues['QuestionHere'][locale.languageCode]; + String get viewDoctorResponses => localizedValues['ViewDoctorResponses'][locale.languageCode]; } diff --git a/lib/uitl/utils.dart b/lib/uitl/utils.dart index b78e5d11..33a1d072 100644 --- a/lib/uitl/utils.dart +++ b/lib/uitl/utils.dart @@ -1,3 +1,6 @@ +import 'dart:convert'; +import 'dart:typed_data'; + import 'package:connectivity/connectivity.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -145,4 +148,8 @@ class Utils { // await pr.hide(); // } } + + static Uint8List dataFromBase64String(String base64String) { + return base64Decode(base64String); + } } diff --git a/lib/widgets/data_display/medical/doctor_card.dart b/lib/widgets/data_display/medical/doctor_card.dart index b7c4a185..b9143682 100644 --- a/lib/widgets/data_display/medical/doctor_card.dart +++ b/lib/widgets/data_display/medical/doctor_card.dart @@ -117,6 +117,7 @@ class DoctorCard extends StatelessWidget { ), ), ), + if(onEmailTap!=null) InkWell( onTap: onEmailTap, child: Icon( diff --git a/lib/widgets/data_display/medical/medical_profile_item.dart b/lib/widgets/data_display/medical/medical_profile_item.dart index e2baa1e4..be6ffba2 100644 --- a/lib/widgets/data_display/medical/medical_profile_item.dart +++ b/lib/widgets/data_display/medical/medical_profile_item.dart @@ -42,7 +42,8 @@ class MedicalProfileItem extends StatelessWidget { alignment: Alignment.bottomRight, child: Image.asset( "assets/images/medical/$imagePath", - height: SizeConfig.heightMultiplier * 7, + height: SizeConfig.heightMultiplier * 5, + width: SizeConfig.heightMultiplier * 5, ), ) ], diff --git a/lib/widgets/dialogs/RadioStringDialog.dart b/lib/widgets/dialogs/RadioStringDialog.dart new file mode 100644 index 00000000..912c3a72 --- /dev/null +++ b/lib/widgets/dialogs/RadioStringDialog.dart @@ -0,0 +1,150 @@ +import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.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'; + +class RadioStringDialog extends StatefulWidget { + final List radioList; + final Function(String) onValueSelected; + final String title; + String selectedValue; + + RadioStringDialog( + {Key key, + this.radioList, + this.onValueSelected, + this.selectedValue, + this.title}); + + @override + _RadioStringDialogState createState() => _RadioStringDialogState(); +} + +class _RadioStringDialogState extends State { + @override + void initState() { + super.initState(); + widget.selectedValue = widget.selectedValue ?? widget.radioList[0]; + } + + @override + Widget build(BuildContext context) { + return SimpleDialog( + title: Container( + width: double.infinity, + child: Center( + child: Texts( + widget.title, + textAlign: TextAlign.center, + ))), + children: [ + Container( + height: widget.radioList.length > 3 + ? MediaQuery.of(context).size.height * 0.6 + : null, + child: SingleChildScrollView( + child: Column( + children: [ + Divider(), + ...List.generate( + widget.radioList.length, + (index) => Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 2, + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + setState(() { + widget.selectedValue = + widget.radioList[index]; + }); + }, + child: ListTile( + title: Text(widget.radioList[index]), + leading: Radio( + value: widget.radioList[index], + groupValue: widget.selectedValue, + activeColor: Colors.red[800], + onChanged: (value) { + setState(() { + widget.selectedValue = value; + }); + }, + ), + ), + ), + ) + ], + ), + SizedBox( + height: 5.0, + ), + ], + ), + ), + SizedBox( + height: 5.0, + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + child: Center( + child: Texts( + TranslationBase.of(context) + .cancel + .toUpperCase(), + color: Colors.red, + ), + ), + ), + ), + ), + ), + Container( + width: 1, + height: 30, + color: Colors.grey[500], + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + widget.onValueSelected(widget.selectedValue); + 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/widgets/others/app_expandable_notifier.dart b/lib/widgets/others/app_expandable_notifier.dart index 353846e1..0f6de09f 100644 --- a/lib/widgets/others/app_expandable_notifier.dart +++ b/lib/widgets/others/app_expandable_notifier.dart @@ -11,9 +11,10 @@ class AppExpandableNotifier extends StatelessWidget { final Widget bodyWidget; final String title; final Widget collapsed; + final Widget header; AppExpandableNotifier( - {this.headerWidget, this.bodyWidget, this.title, this.collapsed}); + {this.headerWidget, this.bodyWidget, this.title, this.collapsed,this.header}); @override Widget build(BuildContext context) { @@ -35,7 +36,7 @@ class AppExpandableNotifier extends StatelessWidget { headerAlignment: ExpandablePanelHeaderAlignment.center, tapBodyToCollapse: true, ), - header: Padding( + header: header ?? Padding( padding: EdgeInsets.all(10), child: Text( title?? 'Details', diff --git a/pubspec.yaml b/pubspec.yaml index ad881e2e..72b2ea9e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -24,7 +24,7 @@ dependencies: connectivity: ^0.4.9 # State Management - provider: ^4.3.1 + provider: ^4.3.2+2 #Dependency Injection get_it: ^4.0.2 @@ -111,11 +111,20 @@ dependencies: #Popup_window popup_box: ^0.1.0 + #datetime_picker + flutter_datetime_picker: ^1.4.0 # Carousel carousel_pro: ^1.0.0 + #local_notifications + flutter_local_notifications: ^1.4.4+4 + #rxdart + rxdart: ^0.24.1 + + #device_calendar + device_calendar: ^3.1.0 #Handle Geolocation geolocator: ^6.0.0+1 @@ -150,6 +159,7 @@ flutter: - assets/images/login/ - assets/json/ - assets/sounds/ + - assets/tracker/ fonts: