Compare commits
98 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 763c4cdb54 | |||
| b37f0f71db | |||
| 8ceb443964 | |||
| a87e52d22c | |||
| 46c281d288 | |||
| 5289cf8511 | |||
| 22ae804c2d | |||
| 1a7293fc12 | |||
| e318e03805 | |||
| 11b6ec9edb | |||
| 2a7e3e17ce | |||
| 9cbdc849b1 | |||
| 0cabe11ab7 | |||
| a561f4fa5f | |||
| 429e91b638 | |||
| c0d152002c | |||
| 1329c8aba4 | |||
| 52f9eb7ba6 | |||
| bcff545dd7 | |||
| 6a5b4f7f4b | |||
|
|
b2b9d8f046 | ||
|
|
4c39e9163b | ||
|
|
6541ac883f | ||
| ffe9f6e9fb | |||
| 8e6f3d7d45 | |||
| abd56d5a14 | |||
| cb25b932ba | |||
| 771d809ce2 | |||
| d6f1629485 | |||
| 39a42048c2 | |||
| 99d0fa4aa8 | |||
| 79ed959b42 | |||
| 23c3cf4173 | |||
| f548db7d82 | |||
| fd2f3a2138 | |||
| 1fe817919f | |||
| 656e1cd3d7 | |||
| a9ea3594b9 | |||
| 7de2cb7b36 | |||
| ac22e50eca | |||
| 9bd039ca25 | |||
| b0d38b4b11 | |||
| 926b749fa8 | |||
| b2ed1e0b51 | |||
| 3dc9ce30e6 | |||
| 91241aa399 | |||
| c79904d132 | |||
| 15106d0a00 | |||
| 2e69e1dd92 | |||
| c89932755f | |||
| 540e13dfe0 | |||
| d51603ff5d | |||
| 553d22dd6b | |||
| 5f5107ee99 | |||
| 6ecce1e9ff | |||
| 22d8c64994 | |||
| ebd78eb72b | |||
| f828ba1786 | |||
| bbadc58ab8 | |||
| a1b7a3ef28 | |||
| 7373a1b8cb | |||
| 0edbfadc90 | |||
| ef479b633d | |||
| 081e7d5533 | |||
| 18e8217ce1 | |||
| cadd51535e | |||
| ba394e7fea | |||
| 04c92804b8 | |||
| a5d72d745d | |||
|
|
a2d1bebca1 | ||
| 69d225f22f | |||
|
|
1a448572ea | ||
| eb4bf4b77b | |||
|
|
04b247aa99 | ||
| 4a1e35d700 | |||
|
|
aa0d756979 | ||
| f6c631c221 | |||
|
|
16f50f826b | ||
| eb2f70e721 | |||
| 07009f832a | |||
| bcdaf55761 | |||
| 81c932a0e6 | |||
| aabaf21248 | |||
| 7a2ba21156 | |||
| d7af659b23 | |||
| 9d807f7d28 | |||
| 6a12fa9e6e | |||
| de4b6e8fcc | |||
| 0f0e19b6f3 | |||
| a4be7fb74d | |||
| 291882abc5 | |||
| ffcee3b7a7 | |||
| 5548a23f69 | |||
| 93e10aad46 | |||
| d7023b8505 | |||
| 52b71cef61 | |||
| 058e852e68 | |||
| e4dc84647d |
@@ -4,7 +4,7 @@
|
||||
# This file should be version controlled and should not be manually edited.
|
||||
|
||||
version:
|
||||
revision: "761747bfc538b5af34aa0d3fac380f1bc331ec49"
|
||||
revision: "8defaa71a77c16e8547abdbfad2053ce3a6e2d5b"
|
||||
channel: "stable"
|
||||
|
||||
project_type: app
|
||||
@@ -13,11 +13,26 @@ project_type: app
|
||||
migration:
|
||||
platforms:
|
||||
- platform: root
|
||||
create_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
|
||||
base_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
|
||||
create_revision: 8defaa71a77c16e8547abdbfad2053ce3a6e2d5b
|
||||
base_revision: 8defaa71a77c16e8547abdbfad2053ce3a6e2d5b
|
||||
- platform: android
|
||||
create_revision: 8defaa71a77c16e8547abdbfad2053ce3a6e2d5b
|
||||
base_revision: 8defaa71a77c16e8547abdbfad2053ce3a6e2d5b
|
||||
- platform: ios
|
||||
create_revision: 8defaa71a77c16e8547abdbfad2053ce3a6e2d5b
|
||||
base_revision: 8defaa71a77c16e8547abdbfad2053ce3a6e2d5b
|
||||
- platform: linux
|
||||
create_revision: 8defaa71a77c16e8547abdbfad2053ce3a6e2d5b
|
||||
base_revision: 8defaa71a77c16e8547abdbfad2053ce3a6e2d5b
|
||||
- platform: macos
|
||||
create_revision: 8defaa71a77c16e8547abdbfad2053ce3a6e2d5b
|
||||
base_revision: 8defaa71a77c16e8547abdbfad2053ce3a6e2d5b
|
||||
- platform: web
|
||||
create_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
|
||||
base_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
|
||||
create_revision: 8defaa71a77c16e8547abdbfad2053ce3a6e2d5b
|
||||
base_revision: 8defaa71a77c16e8547abdbfad2053ce3a6e2d5b
|
||||
- platform: windows
|
||||
create_revision: 8defaa71a77c16e8547abdbfad2053ce3a6e2d5b
|
||||
base_revision: 8defaa71a77c16e8547abdbfad2053ce3a6e2d5b
|
||||
|
||||
# User provided section
|
||||
|
||||
|
||||
3
Frontend/android/.gitignore
vendored
@@ -5,9 +5,10 @@ gradle-wrapper.jar
|
||||
/gradlew.bat
|
||||
/local.properties
|
||||
GeneratedPluginRegistrant.java
|
||||
.cxx/
|
||||
|
||||
# Remember to never publicly share your keystore.
|
||||
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
|
||||
# See https://flutter.dev/to/reference-keystore
|
||||
key.properties
|
||||
**/*.keystore
|
||||
**/*.jks
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
{
|
||||
"agcgw_all":{
|
||||
"CN":"connect-drcn.dbankcloud.cn",
|
||||
"CN_back":"connect-drcn.hispace.hicloud.com",
|
||||
"DE":"connect-dre.dbankcloud.cn",
|
||||
"DE_back":"connect-dre.hispace.hicloud.com",
|
||||
"RU":"connect-drru.hispace.dbankcloud.ru",
|
||||
"RU_back":"connect-drru.hispace.dbankcloud.cn",
|
||||
"SG":"connect-dra.dbankcloud.cn",
|
||||
"SG_back":"connect-dra.hispace.hicloud.com"
|
||||
},
|
||||
"websocketgw_all":{
|
||||
"CN":"connect-ws-drcn.hispace.dbankcloud.cn",
|
||||
"CN_back":"connect-ws-drcn.hispace.dbankcloud.com",
|
||||
"DE":"connect-ws-dre.hispace.dbankcloud.cn",
|
||||
"DE_back":"connect-ws-dre.hispace.dbankcloud.com",
|
||||
"RU":"connect-ws-drru.hispace.dbankcloud.ru",
|
||||
"RU_back":"connect-ws-drru.hispace.dbankcloud.cn",
|
||||
"SG":"connect-ws-dra.hispace.dbankcloud.cn",
|
||||
"SG_back":"connect-ws-dra.hispace.dbankcloud.com"
|
||||
},
|
||||
"client":{
|
||||
"cp_id":"30027000028342692",
|
||||
"product_id":"461323198429473763",
|
||||
"client_id":"1605107650066918016",
|
||||
"client_secret":"F0A7DCFC40BBE823749E9CDAFA95BC7EF6CF37AE4CCC47F20E3434521625E1E1",
|
||||
"project_id":"461323198429473763",
|
||||
"app_id":"113315335",
|
||||
"api_key":"DQEDAFJrB8PGLd+BmY2xafYqt6NgGE+W3ShbW2/b8xNkMTX1Elf1u7NLU73LkMl676mVHeQvLkwluYHi0FEJXEzfXtLR6P6jmW5q5A==",
|
||||
"package_name":"za.co.mzansiinnovationhub.mih"
|
||||
},
|
||||
"oauth_client":{
|
||||
"client_id":"113315335",
|
||||
"client_type":1
|
||||
},
|
||||
"app_info":{
|
||||
"app_id":"113315335",
|
||||
"package_name":"za.co.mzansiinnovationhub.mih"
|
||||
},
|
||||
"configuration_version":"3.0",
|
||||
"appInfos":[
|
||||
{
|
||||
"package_name":"za.co.mzansiinnovationhub.mih",
|
||||
"client":{
|
||||
"app_id":"113315335"
|
||||
},
|
||||
"app_info":{
|
||||
"package_name":"za.co.mzansiinnovationhub.mih",
|
||||
"app_id":"113315335"
|
||||
},
|
||||
"oauth_client":{
|
||||
"client_type":1,
|
||||
"client_id":"113315335"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,103 +0,0 @@
|
||||
plugins {
|
||||
id "com.android.application"
|
||||
id "kotlin-android"
|
||||
id "dev.flutter.flutter-gradle-plugin"
|
||||
}
|
||||
|
||||
def localProperties = new Properties()
|
||||
def localPropertiesFile = rootProject.file('local.properties')
|
||||
if (localPropertiesFile.exists()) {
|
||||
localPropertiesFile.withReader('UTF-8') { reader ->
|
||||
localProperties.load(reader)
|
||||
}
|
||||
}
|
||||
|
||||
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
|
||||
if (flutterVersionCode == null) {
|
||||
flutterVersionCode = '1'
|
||||
}
|
||||
|
||||
def flutterVersionName = localProperties.getProperty('flutter.versionName')
|
||||
if (flutterVersionName == null) {
|
||||
flutterVersionName = '1.0'
|
||||
}
|
||||
|
||||
def keystoreProperties = new Properties()
|
||||
def keystorePropertiesFile = rootProject.file('key.properties')
|
||||
if (keystorePropertiesFile.exists()) {
|
||||
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
|
||||
}
|
||||
|
||||
android {
|
||||
namespace "za.co.mzansiinnovationhub.mih"
|
||||
compileSdkVersion flutter.compileSdkVersion
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_17
|
||||
targetCompatibility JavaVersion.VERSION_17
|
||||
}
|
||||
|
||||
kotlinOptions {
|
||||
jvmTarget = '17'
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main.java.srcDirs += 'src/main/kotlin'
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
||||
applicationId "za.co.mzansiinnovationhub.mih"
|
||||
// You can update the following values to match your application needs.
|
||||
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
|
||||
minSdkVersion 24 //flutter.minSdkVersion
|
||||
targetSdkVersion flutter.targetSdkVersion
|
||||
versionCode flutterVersionCode.toInteger()
|
||||
versionName flutterVersionName
|
||||
multiDexEnabled true
|
||||
}
|
||||
|
||||
signingConfigs {
|
||||
release {
|
||||
keyAlias = keystoreProperties['keyAlias']
|
||||
keyPassword = keystoreProperties['keyPassword']
|
||||
storeFile = keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
|
||||
storePassword = keystoreProperties['storePassword']
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
// TODO: Add your own signing config for the release build.
|
||||
// Signing with the debug keys for now, so `flutter run --release` works.
|
||||
// signingConfig signingConfigs.debug
|
||||
signingConfig = signingConfigs.release
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
flutter {
|
||||
source '../..'
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// implementation("com.google.android.material:material:<version>")
|
||||
implementation "com.google.android.material:material:1.12.0"
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
|
||||
implementation(platform("org.jetbrains.kotlin:kotlin-bom:$kotlin_version"))
|
||||
// implementation 'com.google.android.gms:play-services-ads:23.1.0'
|
||||
// implementation 'com.huawei.agconnect:agconnect-core:1.5.2.300'
|
||||
}
|
||||
|
||||
// apply plugin: 'com.huawei.agconnect'
|
||||
configurations.all {
|
||||
resolutionStrategy {
|
||||
eachDependency { details ->
|
||||
if (details.requested.group == 'org.jetbrains.kotlin') {
|
||||
if (!details.requested.version.startsWith(rootProject.ext.kotlin_version)) {
|
||||
details.useVersion rootProject.ext.kotlin_version
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
69
Frontend/android/app/build.gradle.kts
Normal file
@@ -0,0 +1,69 @@
|
||||
import java.util.Properties
|
||||
import java.io.FileInputStream
|
||||
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
id("kotlin-android")
|
||||
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
|
||||
id("dev.flutter.flutter-gradle-plugin")
|
||||
}
|
||||
|
||||
val keystoreProperties = Properties()
|
||||
val keystorePropertiesFile = rootProject.file("key.properties")
|
||||
if (keystorePropertiesFile.exists()) {
|
||||
keystoreProperties.load(FileInputStream(keystorePropertiesFile))
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "za.co.mzansiinnovationhub.mih"
|
||||
compileSdk = 35
|
||||
ndkVersion = "27.0.12077973"
|
||||
// ndkVersion = flutter.ndkVersion
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_11
|
||||
targetCompatibility = JavaVersion.VERSION_11
|
||||
}
|
||||
|
||||
kotlinOptions {
|
||||
jvmTarget = JavaVersion.VERSION_11.toString()
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
||||
applicationId = "za.co.mzansiinnovationhub.mih"
|
||||
// You can update the following values to match your application needs.
|
||||
// For more information, see: https://flutter.dev/to/review-gradle-config.
|
||||
minSdk = 23
|
||||
//minSdk = flutter.minSdkVersion
|
||||
targetSdk = flutter.targetSdkVersion
|
||||
versionCode = flutter.versionCode
|
||||
versionName = flutter.versionName
|
||||
}
|
||||
|
||||
signingConfigs {
|
||||
create("release") {
|
||||
keyAlias = keystoreProperties["keyAlias"] as String
|
||||
keyPassword = keystoreProperties["keyPassword"] as String
|
||||
storeFile = keystoreProperties["storeFile"]?.let { file(it) }
|
||||
storePassword = keystoreProperties["storePassword"] as String
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
// TODO: Add your own signing config for the release build.
|
||||
// Signing with the debug keys for now, so `flutter run --release` works.
|
||||
signingConfig = signingConfigs.getByName("release")
|
||||
isMinifyEnabled = true
|
||||
proguardFiles(
|
||||
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||
"proguard-rules.pro"
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
flutter {
|
||||
source = "../.."
|
||||
}
|
||||
5
Frontend/android/app/proguard-rules.pro
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
# R8/ProGuard rules to prevent removal of necessary Facebook Infer annotations
|
||||
-keep class com.facebook.infer.annotation.** { *; }
|
||||
-keep interface com.facebook.infer.annotation.** { *; }
|
||||
-dontwarn com.facebook.infer.annotation.Nullsafe$Mode
|
||||
-dontwarn com.facebook.infer.annotation.Nullsafe
|
||||
@@ -15,8 +15,6 @@
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"
|
||||
android:maxSdkVersion="32"
|
||||
tools:replace="android:maxSdkVersion" />
|
||||
<uses-feature android:name="android.hardware.camera" />
|
||||
<uses-permission android:name="android.permission.FLASHLIGHT" />
|
||||
|
||||
<application
|
||||
android:label="MIH"
|
||||
@@ -27,6 +25,7 @@
|
||||
android:name=".MainActivity"
|
||||
android:exported="true"
|
||||
android:launchMode="singleTop"
|
||||
android:taskAffinity=""
|
||||
android:theme="@style/LaunchTheme"
|
||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
||||
android:hardwareAccelerated="true"
|
||||
@@ -63,28 +62,21 @@
|
||||
<data android:scheme="http" android:host="app.mzansi-innovation-hub.co.za" />
|
||||
<data android:scheme="https" android:host="app.mzansi-innovation-hub.co.za" />
|
||||
</intent-filter>
|
||||
<!-- Old Deep Linking -->
|
||||
<!-- <intent-filter android:autoVerify="true">
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
<data android:scheme="http" />
|
||||
<data android:scheme="https" />
|
||||
<data android:host="app.mzansi-innovation-hub.co.za" />
|
||||
</intent-filter> -->
|
||||
</activity>
|
||||
<!-- Don't delete the meta-data below.
|
||||
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
|
||||
<meta-data
|
||||
android:name="flutterEmbedding"
|
||||
android:value="2" />
|
||||
|
||||
<meta-data
|
||||
android:name="com.google.android.gms.ads.APPLICATION_ID"
|
||||
android:value="ca-app-pub-4781880856775334~7553757584"/>
|
||||
</application>
|
||||
<!-- Required to query activities that can process text, see:
|
||||
https://developer.android.com/training/package-visibility and
|
||||
https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.
|
||||
|
||||
<!-- Provide required visibility configuration for API level 30 and above -->
|
||||
In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
|
||||
<queries>
|
||||
<!-- If your app checks for SMS support -->
|
||||
<intent>
|
||||
@@ -100,7 +92,10 @@
|
||||
<intent>
|
||||
<action android:name="android.support.customtabs.action.CustomTabsService" />
|
||||
</intent>
|
||||
<!-- Text to speech android 11 -->
|
||||
<intent>
|
||||
<action android:name="android.intent.action.PROCESS_TEXT"/>
|
||||
<data android:mimeType="text/plain"/>
|
||||
</intent>
|
||||
<intent>
|
||||
<action android:name="android.intent.action.TTS_SERVICE" />
|
||||
</intent>
|
||||
|
||||
@@ -2,5 +2,4 @@ package za.co.mzansiinnovationhub.mih
|
||||
|
||||
import io.flutter.embedding.android.FlutterFragmentActivity
|
||||
|
||||
class MainActivity: FlutterFragmentActivity() {
|
||||
}
|
||||
class MainActivity : FlutterFragmentActivity()
|
||||
|
||||
|
Before Width: | Height: | Size: 9.3 KiB After Width: | Height: | Size: 9.9 KiB |
|
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 6.1 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 34 KiB |
@@ -1,5 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@color/ic_launcher_background"/>
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
|
||||
<foreground>
|
||||
<inset
|
||||
android:drawable="@drawable/ic_launcher_foreground"
|
||||
android:inset="16%" />
|
||||
</foreground>
|
||||
</adaptive-icon>
|
||||
|
||||
|
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 544 B |
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 442 B |
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 8.0 KiB After Width: | Height: | Size: 721 B |
|
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 5.4 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 8.2 KiB After Width: | Height: | Size: 8.6 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
@@ -1,34 +0,0 @@
|
||||
buildscript {
|
||||
ext.kotlin_version = '2.1.21'
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
// maven { url 'https://developer.huawei.com/repo/' }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath "com.android.tools.build:gradle:8.8.1"
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
// classpath 'com.huawei.agconnect:agcp:1.5.2.300'
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
// maven {url 'https://developer.huawei.com/repo/'}
|
||||
}
|
||||
}
|
||||
|
||||
rootProject.buildDir = '../build'
|
||||
subprojects {
|
||||
project.buildDir = "${rootProject.buildDir}/${project.name}"
|
||||
}
|
||||
//subprojects {
|
||||
// project.evaluationDependsOn(':app')
|
||||
//}
|
||||
|
||||
tasks.register("clean", Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
||||
21
Frontend/android/build.gradle.kts
Normal file
@@ -0,0 +1,21 @@
|
||||
allprojects {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
val newBuildDir: Directory = rootProject.layout.buildDirectory.dir("../../build").get()
|
||||
rootProject.layout.buildDirectory.value(newBuildDir)
|
||||
|
||||
subprojects {
|
||||
val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name)
|
||||
project.layout.buildDirectory.value(newSubprojectBuildDir)
|
||||
}
|
||||
subprojects {
|
||||
project.evaluationDependsOn(":app")
|
||||
}
|
||||
|
||||
tasks.register<Delete>("clean") {
|
||||
delete(rootProject.layout.buildDirectory)
|
||||
}
|
||||
@@ -1,6 +1,3 @@
|
||||
org.gradle.jvmargs=-Xmx4G
|
||||
org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError
|
||||
android.useAndroidX=true
|
||||
android.enableJetifier=true
|
||||
android.defaults.buildfeatures.buildconfig=true
|
||||
android.nonTransitiveRClass=false
|
||||
android.nonFinalResIds=false
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-all.zip
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
pluginManagement {
|
||||
def flutterSdkPath = {
|
||||
def properties = new Properties()
|
||||
file("local.properties").withInputStream { properties.load(it) }
|
||||
def flutterSdkPath = properties.getProperty("flutter.sdk")
|
||||
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
|
||||
return flutterSdkPath
|
||||
}
|
||||
settings.ext.flutterSdkPath = flutterSdkPath()
|
||||
|
||||
includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle")
|
||||
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
}
|
||||
|
||||
plugins {
|
||||
id "dev.flutter.flutter-gradle-plugin" version "1.0.0" apply false
|
||||
id "org.jetbrains.kotlin.android" version "2.1.21" apply false
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
|
||||
id "com.android.application" version '8.8.1' apply false
|
||||
}
|
||||
|
||||
include ":app"
|
||||
25
Frontend/android/settings.gradle.kts
Normal file
@@ -0,0 +1,25 @@
|
||||
pluginManagement {
|
||||
val flutterSdkPath = run {
|
||||
val properties = java.util.Properties()
|
||||
file("local.properties").inputStream().use { properties.load(it) }
|
||||
val flutterSdkPath = properties.getProperty("flutter.sdk")
|
||||
require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" }
|
||||
flutterSdkPath
|
||||
}
|
||||
|
||||
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
|
||||
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id("dev.flutter.flutter-plugin-loader") version "1.0.0"
|
||||
id("com.android.application") version "8.7.3" apply false
|
||||
id("org.jetbrains.kotlin.android") version "2.1.0" apply false
|
||||
}
|
||||
|
||||
include(":app")
|
||||
@@ -1,16 +1,16 @@
|
||||
# flutter pub run flutter_launcher_icons
|
||||
flutter_launcher_icons:
|
||||
image_path: "images/app_icon/App_Icon_3.png"
|
||||
image_path: "lib/mih_components/mih_package_components/assets/images/app_icon/mih_app_icon.png"
|
||||
|
||||
android: "launcher_icon"
|
||||
# image_path_android: "assets/icon/icon.png"
|
||||
min_sdk_android: 21 # android min sdk min:16, default 21
|
||||
adaptive_icon_background: "#3A4454"
|
||||
adaptive_icon_foreground: "images/app_icon/App_Icon_3.png"
|
||||
adaptive_icon_foreground: "lib/mih_components/mih_package_components/assets/images/app_icon/mih_app_icon.png"
|
||||
# adaptive_icon_monochrome: "assets/icon/monochrome.png"
|
||||
|
||||
ios: true
|
||||
image_path_ios: "images/app_icon/mih_app_icon.png"
|
||||
image_path_ios: "lib/mih_components/mih_package_components/assets/images/app_icon/mih_app_icon.png"
|
||||
remove_alpha_channel_ios: true
|
||||
# image_path_ios_dark_transparent: "assets/icon/icon_dark.png"
|
||||
# image_path_ios_tinted_grayscale: "assets/icon/icon_tinted.png"
|
||||
@@ -18,15 +18,15 @@ flutter_launcher_icons:
|
||||
|
||||
web:
|
||||
generate: true
|
||||
image_path: "images/app_icon/circle_logo.png"
|
||||
image_path: "lib/mih_components/mih_package_components/assets/images/app_icon/circle_logo.png"
|
||||
background_color: "#3A4454"
|
||||
theme_color: "#3A4454"
|
||||
|
||||
windows:
|
||||
generate: true
|
||||
image_path: "images/app_icon/circle_logo.png"
|
||||
image_path: "lib/mih_components/mih_package_components/assets/images/app_icon/circle_logo.png"
|
||||
icon_size: 48 # min:48, max:256, default: 48
|
||||
|
||||
macos:
|
||||
generate: true
|
||||
image_path: "images/app_icon/circle_logo.png"
|
||||
image_path: "lib/mih_components/mih_package_components/assets/images/app_icon/circle_logo.png"
|
||||
|
||||
@@ -34,9 +34,12 @@ PODS:
|
||||
- DKPhotoGallery/Resource (0.0.19):
|
||||
- SDWebImage
|
||||
- SwiftyGif
|
||||
- FBAudienceNetwork (6.20.1)
|
||||
- file_picker (0.0.1):
|
||||
- DKImagePickerController/PhotoGallery
|
||||
- Flutter
|
||||
- file_saver (0.0.1):
|
||||
- Flutter
|
||||
- fl_downloader (0.0.1):
|
||||
- Flutter
|
||||
- Flutter (1.0.0)
|
||||
@@ -47,12 +50,18 @@ PODS:
|
||||
- geolocator_apple (1.2.0):
|
||||
- Flutter
|
||||
- FlutterMacOS
|
||||
- gma_mediation_meta (1.4.1):
|
||||
- Flutter
|
||||
- GoogleMobileAdsMediationFacebook (~> 6.20.1.0)
|
||||
- Google-Mobile-Ads-SDK (12.2.0):
|
||||
- GoogleUserMessagingPlatform (>= 1.1)
|
||||
- google_mobile_ads (6.0.0):
|
||||
- Flutter
|
||||
- Google-Mobile-Ads-SDK (~> 12.2.0)
|
||||
- webview_flutter_wkwebview
|
||||
- GoogleMobileAdsMediationFacebook (6.20.1.0):
|
||||
- FBAudienceNetwork (= 6.20.1)
|
||||
- Google-Mobile-Ads-SDK (~> 12.0)
|
||||
- GoogleUserMessagingPlatform (3.0.0)
|
||||
- local_auth_darwin (0.0.1):
|
||||
- Flutter
|
||||
@@ -60,6 +69,8 @@ PODS:
|
||||
- mobile_scanner (7.0.0):
|
||||
- Flutter
|
||||
- FlutterMacOS
|
||||
- package_info_plus (0.4.5):
|
||||
- Flutter
|
||||
- path_provider_foundation (0.0.1):
|
||||
- Flutter
|
||||
- FlutterMacOS
|
||||
@@ -91,14 +102,17 @@ DEPENDENCIES:
|
||||
- app_settings (from `.symlinks/plugins/app_settings/ios`)
|
||||
- device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
|
||||
- file_picker (from `.symlinks/plugins/file_picker/ios`)
|
||||
- file_saver (from `.symlinks/plugins/file_saver/ios`)
|
||||
- fl_downloader (from `.symlinks/plugins/fl_downloader/ios`)
|
||||
- Flutter (from `Flutter`)
|
||||
- flutter_native_splash (from `.symlinks/plugins/flutter_native_splash/ios`)
|
||||
- flutter_tts (from `.symlinks/plugins/flutter_tts/ios`)
|
||||
- geolocator_apple (from `.symlinks/plugins/geolocator_apple/darwin`)
|
||||
- gma_mediation_meta (from `.symlinks/plugins/gma_mediation_meta/ios`)
|
||||
- google_mobile_ads (from `.symlinks/plugins/google_mobile_ads/ios`)
|
||||
- local_auth_darwin (from `.symlinks/plugins/local_auth_darwin/darwin`)
|
||||
- mobile_scanner (from `.symlinks/plugins/mobile_scanner/darwin`)
|
||||
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
|
||||
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
|
||||
- printing (from `.symlinks/plugins/printing/ios`)
|
||||
- screen_brightness_ios (from `.symlinks/plugins/screen_brightness_ios/ios`)
|
||||
@@ -113,7 +127,9 @@ SPEC REPOS:
|
||||
trunk:
|
||||
- DKImagePickerController
|
||||
- DKPhotoGallery
|
||||
- FBAudienceNetwork
|
||||
- Google-Mobile-Ads-SDK
|
||||
- GoogleMobileAdsMediationFacebook
|
||||
- GoogleUserMessagingPlatform
|
||||
- SDWebImage
|
||||
- SwiftyGif
|
||||
@@ -125,6 +141,8 @@ EXTERNAL SOURCES:
|
||||
:path: ".symlinks/plugins/device_info_plus/ios"
|
||||
file_picker:
|
||||
:path: ".symlinks/plugins/file_picker/ios"
|
||||
file_saver:
|
||||
:path: ".symlinks/plugins/file_saver/ios"
|
||||
fl_downloader:
|
||||
:path: ".symlinks/plugins/fl_downloader/ios"
|
||||
Flutter:
|
||||
@@ -135,12 +153,16 @@ EXTERNAL SOURCES:
|
||||
:path: ".symlinks/plugins/flutter_tts/ios"
|
||||
geolocator_apple:
|
||||
:path: ".symlinks/plugins/geolocator_apple/darwin"
|
||||
gma_mediation_meta:
|
||||
:path: ".symlinks/plugins/gma_mediation_meta/ios"
|
||||
google_mobile_ads:
|
||||
:path: ".symlinks/plugins/google_mobile_ads/ios"
|
||||
local_auth_darwin:
|
||||
:path: ".symlinks/plugins/local_auth_darwin/darwin"
|
||||
mobile_scanner:
|
||||
:path: ".symlinks/plugins/mobile_scanner/darwin"
|
||||
package_info_plus:
|
||||
:path: ".symlinks/plugins/package_info_plus/ios"
|
||||
path_provider_foundation:
|
||||
:path: ".symlinks/plugins/path_provider_foundation/darwin"
|
||||
printing:
|
||||
@@ -165,17 +187,22 @@ SPEC CHECKSUMS:
|
||||
device_info_plus: 21fcca2080fbcd348be798aa36c3e5ed849eefbe
|
||||
DKImagePickerController: 946cec48c7873164274ecc4624d19e3da4c1ef3c
|
||||
DKPhotoGallery: b3834fecb755ee09a593d7c9e389d8b5d6deed60
|
||||
FBAudienceNetwork: 08e86d63a05b3a5a59414af12e4af8d756943c80
|
||||
file_picker: a0560bc09d61de87f12d246fc47d2119e6ef37be
|
||||
file_saver: 6cdbcddd690cb02b0c1a0c225b37cd805c2bf8b6
|
||||
fl_downloader: dc99aa8dd303f862cccb830087f37acc9b0156ee
|
||||
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
|
||||
flutter_native_splash: c32d145d68aeda5502d5f543ee38c192065986cf
|
||||
flutter_tts: b88dbc8655d3dc961bc4a796e4e16a4cc1795833
|
||||
geolocator_apple: ab36aa0e8b7d7a2d7639b3b4e48308394e8cef5e
|
||||
gma_mediation_meta: 44defcf3b61414cdca65c0f897360e31b9332a09
|
||||
Google-Mobile-Ads-SDK: 1dfb0c3cb46c7e2b00b0f4de74a1e06d9ea25d67
|
||||
google_mobile_ads: 535223588a6791b7a3cc3513a1bc7b89d12f3e62
|
||||
GoogleMobileAdsMediationFacebook: b11a92ae3bfdae19853b882252b7e62791c18162
|
||||
GoogleUserMessagingPlatform: f8d0cdad3ca835406755d0a69aa634f00e76d576
|
||||
local_auth_darwin: 553ce4f9b16d3fdfeafce9cf042e7c9f77c1c391
|
||||
mobile_scanner: 9157936403f5a0644ca3779a38ff8404c5434a93
|
||||
package_info_plus: af8e2ca6888548050f16fa2f1938db7b5a5df499
|
||||
path_provider_foundation: 080d55be775b7414fd5a5ef3ac137b97b097e564
|
||||
printing: 54ff03f28fe9ba3aa93358afb80a8595a071dd07
|
||||
screen_brightness_ios: 9953fd7da5bd480f1a93990daeec2eb42d4f3b52
|
||||
|
||||
|
Before Width: | Height: | Size: 127 KiB After Width: | Height: | Size: 126 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 4.8 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 6.9 KiB |
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.6 KiB |
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 6.4 KiB |
|
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 6.9 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 8.5 KiB After Width: | Height: | Size: 8.6 KiB |
|
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 9.1 KiB After Width: | Height: | Size: 9.1 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
@@ -2,6 +2,19 @@
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>ITSAppUsesNonExemptEncryption</key>
|
||||
<false/>
|
||||
<key>SKAdNetworkItems</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>SKAdNetworkIdentifier</key>
|
||||
<string>v9wttpbfk9.skadnetwork</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>SKAdNetworkIdentifier</key>
|
||||
<string>n38lu8286q.skadnetwork</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>GADApplicationIdentifier</key>
|
||||
<string>ca-app-pub-4781880856775334~6935644635</string>
|
||||
<key>CADisableMinimumFrameDurationOnPhone</key>
|
||||
@@ -41,6 +54,8 @@
|
||||
<string>Why is my app authenticating using face id?</string>
|
||||
<key>NSLocationWhenInUseUsageDescription</key>
|
||||
<string>This app needs access to location when open.</string>
|
||||
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
|
||||
<string>This app needs access to your location at all times to provide [Explain your specific, complete reason here, e.g., real-time tracking, background updates, etc.].</string>
|
||||
<key>NSPhotoLibraryUsageDescription</key>
|
||||
<string>This app needs to access your photo library to select images.</string>
|
||||
<key>NSDownloadsFolderUsageDescription</key>
|
||||
|
||||
@@ -1,6 +1,20 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_providers/about_mih_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_providers/mih_access_controlls_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_providers/mih_authentication_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_providers/mih_banner_ad_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_providers/mih_calculator_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_providers/mih_calendar_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_providers/mih_mine_sweeper_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_providers/mzansi_ai_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_providers/mzansi_directory_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_providers/mzansi_profile_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_providers/mzansi_wallet_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_providers/patient_manager_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:upgrader/upgrader.dart';
|
||||
import 'mih_config/mih_env.dart';
|
||||
import 'mih_config/mih_theme.dart';
|
||||
|
||||
@@ -65,13 +79,66 @@ class _MzansiInnovationHubState extends State<MzansiInnovationHub> {
|
||||
double width = MediaQuery.sizeOf(context).width;
|
||||
theme.setScreenType(width);
|
||||
precacheImage(theme.loadingImage(), context);
|
||||
return MaterialApp.router(
|
||||
return MultiProvider(
|
||||
providers: [
|
||||
ChangeNotifierProvider(
|
||||
create: (context) => MihAuthenticationProvider(),
|
||||
),
|
||||
ChangeNotifierProvider(
|
||||
create: (context) => MzansiProfileProvider(),
|
||||
),
|
||||
ChangeNotifierProvider(
|
||||
create: (context) => MzansiWalletProvider(),
|
||||
),
|
||||
ChangeNotifierProvider(
|
||||
create: (context) => MzansiAiProvider(),
|
||||
),
|
||||
ChangeNotifierProvider(
|
||||
create: (context) => MzansiDirectoryProvider(),
|
||||
),
|
||||
ChangeNotifierProvider(
|
||||
create: (context) => MihBannerAdProvider(),
|
||||
),
|
||||
ChangeNotifierProvider(
|
||||
create: (context) => MihCalculatorProvider(),
|
||||
),
|
||||
ChangeNotifierProvider(
|
||||
create: (context) => MihAccessControllsProvider(),
|
||||
),
|
||||
ChangeNotifierProvider(
|
||||
create: (context) => MihCalendarProvider(),
|
||||
),
|
||||
ChangeNotifierProvider(
|
||||
create: (context) => AboutMihProvider(),
|
||||
),
|
||||
ChangeNotifierProvider(
|
||||
create: (context) => MihMineSweeperProvider(),
|
||||
),
|
||||
ChangeNotifierProvider(
|
||||
create: (context) => PatientManagerProvider(),
|
||||
),
|
||||
],
|
||||
child: MaterialApp.router(
|
||||
title: getTitle(),
|
||||
themeMode: ThemeMode.dark,
|
||||
theme: theme.getThemeData(),
|
||||
darkTheme: theme.getThemeData(),
|
||||
debugShowCheckedModeBanner: false,
|
||||
routerConfig: widget.router,
|
||||
builder: (context, child) {
|
||||
if (child == null) {
|
||||
return const Scaffold(
|
||||
body: Center(
|
||||
child: CircularProgressIndicator(),
|
||||
),
|
||||
);
|
||||
}
|
||||
return UpgradeAlert(
|
||||
navigatorKey: widget.router.routerDelegate.navigatorKey,
|
||||
child: child,
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -20,6 +20,12 @@ void main() async {
|
||||
apiBasePath: "/auth",
|
||||
);
|
||||
if (!kIsWeb) {
|
||||
const List<String> testDeviceIds = ['733d4c68-9b54-453a-9622-2df407310f40'];
|
||||
MobileAds.instance.updateRequestConfiguration(
|
||||
RequestConfiguration(
|
||||
testDeviceIds: testDeviceIds,
|
||||
),
|
||||
);
|
||||
MobileAds.instance.initialize();
|
||||
} else {
|
||||
usePathUrlStrategy();
|
||||
@@ -29,5 +35,7 @@ void main() async {
|
||||
});
|
||||
final GoRouter appRouter = MihGoRouter().mihRouter;
|
||||
FlutterNativeSplash.remove();
|
||||
runApp(MzansiInnovationHub(router: appRouter,));
|
||||
runApp(MzansiInnovationHub(
|
||||
router: appRouter,
|
||||
));
|
||||
}
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
class MinesweeperPlayerScore {
|
||||
String app_id;
|
||||
String username;
|
||||
String proPicUrl;
|
||||
String difficulty;
|
||||
String game_time;
|
||||
double game_score;
|
||||
DateTime played_date;
|
||||
|
||||
MinesweeperPlayerScore({
|
||||
required this.app_id,
|
||||
required this.username,
|
||||
required this.proPicUrl,
|
||||
required this.difficulty,
|
||||
required this.game_time,
|
||||
required this.game_score,
|
||||
required this.played_date,
|
||||
});
|
||||
|
||||
factory MinesweeperPlayerScore.fromJson(Map<String, dynamic> json) {
|
||||
return MinesweeperPlayerScore(
|
||||
app_id: json['app_id'],
|
||||
username: json['username'],
|
||||
proPicUrl: json['proPicUrl'],
|
||||
difficulty: json['difficulty'],
|
||||
game_time: json['game_time'],
|
||||
game_score: json['game_score'],
|
||||
played_date: DateTime.parse(json['played_date']),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'app_id': app_id,
|
||||
'username': username,
|
||||
'proPicUrl': proPicUrl,
|
||||
'difficulty': difficulty,
|
||||
'game_time': game_score,
|
||||
'played_date': played_date.toIso8601String(),
|
||||
};
|
||||
}
|
||||
}
|
||||
29
Frontend/lib/mih_components/mih_objects/user_consent.dart
Normal file
@@ -0,0 +1,29 @@
|
||||
class UserConsent {
|
||||
String app_id;
|
||||
DateTime privacy_policy_accepted;
|
||||
DateTime terms_of_services_accepted;
|
||||
|
||||
UserConsent({
|
||||
required this.app_id,
|
||||
required this.privacy_policy_accepted,
|
||||
required this.terms_of_services_accepted,
|
||||
});
|
||||
|
||||
factory UserConsent.fromJson(Map<String, dynamic> json) {
|
||||
return UserConsent(
|
||||
app_id: json['app_id'],
|
||||
privacy_policy_accepted: DateTime.parse(json['privacy_policy_accepted']),
|
||||
terms_of_services_accepted:
|
||||
DateTime.parse(json['terms_of_services_accepted']),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'app_id': app_id,
|
||||
'privacy_policy_accepted': privacy_policy_accepted.toIso8601String(),
|
||||
'terms_of_services_accepted':
|
||||
terms_of_services_accepted.toIso8601String(),
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -396,7 +396,6 @@ class _PackageToolOneState extends State<PackageToolOne> {
|
||||
return widget.business != null
|
||||
? MihBusinessProfilePreview(
|
||||
business: widget.business!,
|
||||
myLocation: myLocation,
|
||||
)
|
||||
: Text("NoBusiness Data");
|
||||
}
|
||||
@@ -424,7 +423,7 @@ class _PackageToolOneState extends State<PackageToolOne> {
|
||||
"rating",
|
||||
"mission_vision",
|
||||
),
|
||||
startUpSearch: '',
|
||||
// startUpSearch: '',
|
||||
width: 300,
|
||||
).redacted(
|
||||
context: context,
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
@font-face {
|
||||
font-family: 'Mih_Icons';
|
||||
src: url('fonts/Mih_Icons.eot?blbuxz');
|
||||
src: url('fonts/Mih_Icons.eot?blbuxz#iefix') format('embedded-opentype'),
|
||||
url('fonts/Mih_Icons.ttf?blbuxz') format('truetype'),
|
||||
url('fonts/Mih_Icons.woff?blbuxz') format('woff'),
|
||||
url('fonts/Mih_Icons.svg?blbuxz#Mih_Icons') format('svg');
|
||||
font-family: 'icomoon';
|
||||
src: url('fonts/icomoon.eot?8flwgj');
|
||||
src: url('fonts/icomoon.eot?8flwgj#iefix') format('embedded-opentype'),
|
||||
url('fonts/icomoon.ttf?8flwgj') format('truetype'),
|
||||
url('fonts/icomoon.woff?8flwgj') format('woff'),
|
||||
url('fonts/icomoon.svg?8flwgj#icomoon') format('svg');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
font-display: block;
|
||||
@@ -13,7 +13,7 @@
|
||||
[class^="icon-"],
|
||||
[class*=" icon-"] {
|
||||
/* use !important to prevent issues with browser extensions that change fonts */
|
||||
font-family: 'Mih_Icons' !important;
|
||||
font-family: 'icomoon' !important;
|
||||
/* speak: never; */
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
@@ -26,70 +26,74 @@
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.icon-mzansi_directory:before {
|
||||
.icon-mine_sweeper:before {
|
||||
content: "\e900";
|
||||
}
|
||||
|
||||
.icon-personal_profile:before {
|
||||
.icon-mzansi_directory:before {
|
||||
content: "\e901";
|
||||
}
|
||||
|
||||
.icon-about_mih:before {
|
||||
.icon-personal_profile:before {
|
||||
content: "\e902";
|
||||
}
|
||||
|
||||
.icon-access_control:before {
|
||||
.icon-about_mih:before {
|
||||
content: "\e903";
|
||||
}
|
||||
|
||||
.icon-business_profile:before {
|
||||
.icon-access_control:before {
|
||||
content: "\e904";
|
||||
}
|
||||
|
||||
.icon-business_setup:before {
|
||||
.icon-business_profile:before {
|
||||
content: "\e905";
|
||||
}
|
||||
|
||||
.icon-i_dont_know:before {
|
||||
.icon-business_setup:before {
|
||||
content: "\e906";
|
||||
}
|
||||
|
||||
.icon-mih_logo:before {
|
||||
.icon-calculator:before {
|
||||
content: "\e907";
|
||||
}
|
||||
|
||||
.icon-mih_ring:before {
|
||||
.icon-calendar:before {
|
||||
content: "\e908";
|
||||
}
|
||||
|
||||
.icon-mzansi_ai:before {
|
||||
.icon-i_dont_know:before {
|
||||
content: "\e909";
|
||||
}
|
||||
|
||||
.icon-mzansi_wallet:before {
|
||||
.icon-mih_logo:before {
|
||||
content: "\e90a";
|
||||
}
|
||||
|
||||
.icon-notifications:before {
|
||||
.icon-mih_ring:before {
|
||||
content: "\e90b";
|
||||
}
|
||||
|
||||
.icon-patient_manager:before {
|
||||
.icon-mzansi_ai:before {
|
||||
content: "\e90c";
|
||||
}
|
||||
|
||||
.icon-patient_profile:before {
|
||||
.icon-mzansi_wallet:before {
|
||||
content: "\e90d";
|
||||
}
|
||||
|
||||
.icon-profile_setup:before {
|
||||
.icon-notifications:before {
|
||||
content: "\e90e";
|
||||
}
|
||||
|
||||
.icon-calculator:before {
|
||||
content: "\e940";
|
||||
.icon-patient_manager:before {
|
||||
content: "\e90f";
|
||||
}
|
||||
|
||||
.icon-calendar:before {
|
||||
content: "\e953";
|
||||
.icon-patient_profile:before {
|
||||
content: "\e910";
|
||||
}
|
||||
|
||||
.icon-profile_setup:before {
|
||||
content: "\e911";
|
||||
}
|
||||
|
After Width: | Height: | Size: 23 KiB |
@@ -1,6 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:google_mobile_ads/google_mobile_ads.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_providers/mih_banner_ad_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_env.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class MihBannerAd extends StatefulWidget {
|
||||
const MihBannerAd({super.key});
|
||||
@@ -10,66 +12,44 @@ class MihBannerAd extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _MihBannerAdState extends State<MihBannerAd> {
|
||||
BannerAd? _bannerAd;
|
||||
bool _isBannerAdLoaded = false;
|
||||
final adUnitId = AppEnviroment.bannerAdUnitId;
|
||||
String errorMessage = '';
|
||||
|
||||
void _loadBannerAd() {
|
||||
_bannerAd = BannerAd(
|
||||
adUnitId: adUnitId,
|
||||
request: const AdRequest(),
|
||||
size: AdSize.banner,
|
||||
listener: BannerAdListener(
|
||||
onAdLoaded: (ad) {
|
||||
debugPrint('$ad loaded.');
|
||||
setState(() {
|
||||
_isBannerAdLoaded = true;
|
||||
});
|
||||
},
|
||||
onAdFailedToLoad: (ad, err) {
|
||||
debugPrint('BannerAd failed to load: $err');
|
||||
setState(() {
|
||||
errorMessage =
|
||||
'Failed to load ad- Message: ${err.message} Code :${err.code}';
|
||||
});
|
||||
ad.dispose(); // Dispose the ad to free resources
|
||||
},
|
||||
onAdOpened: (Ad ad) => debugPrint('$ad opened.'),
|
||||
onAdClosed: (Ad ad) => debugPrint('$ad closed.'),
|
||||
onAdImpression: (Ad ad) => debugPrint('$ad impression.'),
|
||||
),
|
||||
);
|
||||
|
||||
_bannerAd!.load();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_bannerAd?.dispose(); // Dispose the ad when the widget is removed
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_loadBannerAd();
|
||||
MihBannerAdProvider adProvider = context.read<MihBannerAdProvider>();
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
adProvider.reset();
|
||||
adProvider.loadBannerAd();
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Consumer<MihBannerAdProvider>(
|
||||
builder: (context, bannerAdProvider, child) {
|
||||
if (!bannerAdProvider.isBannerAdLoaded) {
|
||||
return SizedBox();
|
||||
}
|
||||
return Column(
|
||||
children: [
|
||||
_bannerAd != null && _isBannerAdLoaded
|
||||
bannerAdProvider.bannerAd != null &&
|
||||
bannerAdProvider.isBannerAdLoaded
|
||||
? SizedBox(
|
||||
width: _bannerAd!.size.width.toDouble(),
|
||||
height: _bannerAd!.size.height.toDouble(),
|
||||
child: AdWidget(ad: _bannerAd!))
|
||||
width: bannerAdProvider.bannerAd!.size.width.toDouble(),
|
||||
height: bannerAdProvider.bannerAd!.size.height.toDouble(),
|
||||
child: AdWidget(ad: bannerAdProvider.bannerAd!))
|
||||
: SizedBox(
|
||||
child:
|
||||
Text(AppEnviroment.getEnv() == "Dev" ? errorMessage : ""),
|
||||
child: Text(AppEnviroment.getEnv() == "Dev"
|
||||
? bannerAdProvider.errorMessage
|
||||
: ""),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,17 +4,17 @@ import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_objects/business.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_circle_avatar.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_icons.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_providers/mzansi_directory_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_services/mih_file_services.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_services/mih_location_services.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class MihBusinessProfilePreview extends StatefulWidget {
|
||||
final Business business;
|
||||
final String? myLocation;
|
||||
const MihBusinessProfilePreview({
|
||||
super.key,
|
||||
required this.business,
|
||||
required this.myLocation,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -26,10 +26,10 @@ class _MihBusinessProfilePreviewState extends State<MihBusinessProfilePreview> {
|
||||
late Future<String> futureImageUrl;
|
||||
PlatformFile? file;
|
||||
|
||||
String calculateDistance() {
|
||||
String calculateDistance(MzansiDirectoryProvider directoryProvider) {
|
||||
try {
|
||||
double distanceInKm = MIHLocationAPI().getDistanceInMeaters(
|
||||
widget.myLocation!, widget.business.gps_location) /
|
||||
directoryProvider.userLocation, widget.business.gps_location) /
|
||||
1000;
|
||||
return "${distanceInKm.toStringAsFixed(2)} km";
|
||||
} catch (error) {
|
||||
@@ -41,17 +41,19 @@ class _MihBusinessProfilePreviewState extends State<MihBusinessProfilePreview> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
futureImageUrl =
|
||||
MihFileApi.getMinioFileUrl(widget.business.logo_path, context);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
double profilePictureWidth = 60;
|
||||
return Consumer<MzansiDirectoryProvider>(
|
||||
builder: (BuildContext context, MzansiDirectoryProvider directoryProvider,
|
||||
Widget? child) {
|
||||
return Row(
|
||||
children: [
|
||||
FutureBuilder(
|
||||
future: futureImageUrl,
|
||||
future: MihFileApi.getMinioFileUrl(
|
||||
widget.business.logo_path, context),
|
||||
builder: (context, asyncSnapshot) {
|
||||
if (asyncSnapshot.connectionState == ConnectionState.done &&
|
||||
asyncSnapshot.hasData) {
|
||||
@@ -63,9 +65,11 @@ class _MihBusinessProfilePreviewState extends State<MihBusinessProfilePreview> {
|
||||
fileNameController: TextEditingController(),
|
||||
userSelectedfile: file,
|
||||
frameColor: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
backgroundColor: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
onChange: () {},
|
||||
);
|
||||
} else {
|
||||
@@ -73,7 +77,8 @@ class _MihBusinessProfilePreviewState extends State<MihBusinessProfilePreview> {
|
||||
MihIcons.iDontKnow,
|
||||
size: profilePictureWidth,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
);
|
||||
}
|
||||
} else {
|
||||
@@ -81,7 +86,8 @@ class _MihBusinessProfilePreviewState extends State<MihBusinessProfilePreview> {
|
||||
MihIcons.mihRing,
|
||||
size: profilePictureWidth,
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||
"Dark"),
|
||||
);
|
||||
}
|
||||
}),
|
||||
@@ -104,8 +110,8 @@ class _MihBusinessProfilePreviewState extends State<MihBusinessProfilePreview> {
|
||||
),
|
||||
),
|
||||
Text(
|
||||
widget.myLocation != null || widget.myLocation!.isEmpty
|
||||
? calculateDistance()
|
||||
directoryProvider.userPosition != null
|
||||
? calculateDistance(directoryProvider)
|
||||
: "0.00 km",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
@@ -116,5 +122,7 @@ class _MihBusinessProfilePreviewState extends State<MihBusinessProfilePreview> {
|
||||
)
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||
|
||||
class MihButton extends StatelessWidget {
|
||||
final void Function()? onPressed;
|
||||
final void Function()? onLongPressed;
|
||||
final Color buttonColor;
|
||||
final double? width;
|
||||
final double? height;
|
||||
@@ -12,6 +13,7 @@ class MihButton extends StatelessWidget {
|
||||
const MihButton({
|
||||
super.key,
|
||||
required this.onPressed,
|
||||
this.onLongPressed,
|
||||
required this.buttonColor,
|
||||
this.width,
|
||||
this.height,
|
||||
@@ -49,6 +51,7 @@ class MihButton extends StatelessWidget {
|
||||
highlightColor: rippleColor.withValues(alpha: 0.2),
|
||||
hoverColor: rippleColor.withValues(alpha: 0.3),
|
||||
onTap: onPressed,
|
||||
onLongPress: onLongPressed,
|
||||
child: Container(
|
||||
width: width,
|
||||
height: height,
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:ken_logger/ken_logger.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_providers/mih_calendar_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:table_calendar/table_calendar.dart';
|
||||
|
||||
class MIHCalendar extends StatefulWidget {
|
||||
@@ -19,16 +22,29 @@ class MIHCalendar extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _MIHCalendarState extends State<MIHCalendar> {
|
||||
DateTime selectedDay = DateTime.now();
|
||||
late DateTime selectedDay;
|
||||
CalendarFormat _calendarFormat = CalendarFormat.week;
|
||||
|
||||
void onDaySelected(DateTime day, DateTime focusedDay) {
|
||||
KenLogger.success("Selected Day: $day");
|
||||
setState(() {
|
||||
selectedDay = day;
|
||||
});
|
||||
widget.setDate(selectedDay.toString().split(" ")[0]);
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
MihCalendarProvider mihCalendarProvider =
|
||||
context.read<MihCalendarProvider>();
|
||||
if (mihCalendarProvider.selectedDay.isNotEmpty) {
|
||||
selectedDay = DateTime.parse(mihCalendarProvider.selectedDay);
|
||||
} else {
|
||||
selectedDay = DateTime.now();
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SizedBox(
|
||||
|
||||
@@ -10,7 +10,7 @@ class MihCircleAvatar extends StatefulWidget {
|
||||
final ImageProvider<Object>? imageFile;
|
||||
final double width;
|
||||
final bool editable;
|
||||
final TextEditingController fileNameController;
|
||||
final TextEditingController? fileNameController;
|
||||
final onChange;
|
||||
final PlatformFile? userSelectedfile;
|
||||
final Color frameColor;
|
||||
@@ -73,6 +73,7 @@ class _MihCircleAvatarState extends State<MihCircleAvatar> {
|
||||
Visibility(
|
||||
visible: imagePreview != null,
|
||||
child: Positioned(
|
||||
right: widget.width * 0.03,
|
||||
child: CircleAvatar(
|
||||
radius: widget.width / 2.2,
|
||||
backgroundColor: widget.backgroundColor,
|
||||
@@ -129,7 +130,7 @@ class _MihCircleAvatarState extends State<MihCircleAvatar> {
|
||||
});
|
||||
|
||||
setState(() {
|
||||
widget.fileNameController.text = selectedFile.name;
|
||||
widget.fileNameController!.text = selectedFile.name;
|
||||
});
|
||||
} else {
|
||||
if (result != null) {
|
||||
@@ -147,7 +148,7 @@ class _MihCircleAvatarState extends State<MihCircleAvatar> {
|
||||
});
|
||||
|
||||
setState(() {
|
||||
widget.fileNameController.text =
|
||||
widget.fileNameController!.text =
|
||||
file.path.split('/').last;
|
||||
});
|
||||
} else {
|
||||
@@ -156,7 +157,7 @@ class _MihCircleAvatarState extends State<MihCircleAvatar> {
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
print("Error: $e");
|
||||
print("Here Error: $e");
|
||||
}
|
||||
},
|
||||
icon: Icon(
|
||||
|
||||
@@ -10,6 +10,7 @@ class MihDropdownField extends StatefulWidget {
|
||||
final bool editable;
|
||||
final bool enableSearch;
|
||||
final FormFieldValidator<String>? validator;
|
||||
final Function(String?)? onSelected;
|
||||
|
||||
const MihDropdownField({
|
||||
super.key,
|
||||
@@ -20,6 +21,7 @@ class MihDropdownField extends StatefulWidget {
|
||||
required this.editable,
|
||||
required this.enableSearch,
|
||||
this.validator,
|
||||
this.onSelected,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -117,8 +119,10 @@ class _MihDropdownFieldState extends State<MihDropdownField> {
|
||||
enableSearch: widget.enableSearch,
|
||||
enableFilter: widget.enableSearch,
|
||||
enabled: widget.editable,
|
||||
textInputAction: TextInputAction.search,
|
||||
requestFocusOnTap: true,
|
||||
textInputAction: widget.enableSearch
|
||||
? TextInputAction.search
|
||||
: TextInputAction.none,
|
||||
requestFocusOnTap: widget.enableSearch,
|
||||
menuHeight: 400,
|
||||
expandedInsets: EdgeInsets.zero,
|
||||
textStyle: TextStyle(
|
||||
@@ -153,6 +157,7 @@ class _MihDropdownFieldState extends State<MihDropdownField> {
|
||||
),
|
||||
onSelected: (String? selectedValue) {
|
||||
field.didChange(selectedValue);
|
||||
widget.onSelected?.call(selectedValue);
|
||||
},
|
||||
menuStyle: MenuStyle(
|
||||
backgroundColor: WidgetStatePropertyAll(
|
||||
|
||||
@@ -11,54 +11,57 @@ class MihIcons {
|
||||
// IconData constants based on your style.css file
|
||||
// Note: We convert the hex code from CSS (\eXXX) to an integer (0xeXXX)
|
||||
|
||||
static const IconData mzansiDirectory =
|
||||
static const IconData mineSweeper =
|
||||
IconData(0xe900, fontFamily: _mihFontFam, fontPackage: _mihFontPkg);
|
||||
|
||||
static const IconData personalProfile =
|
||||
static const IconData mzansiDirectory =
|
||||
IconData(0xe901, fontFamily: _mihFontFam, fontPackage: _mihFontPkg);
|
||||
|
||||
static const IconData aboutMih =
|
||||
static const IconData personalProfile =
|
||||
IconData(0xe902, fontFamily: _mihFontFam, fontPackage: _mihFontPkg);
|
||||
|
||||
static const IconData accessControl =
|
||||
static const IconData aboutMih =
|
||||
IconData(0xe903, fontFamily: _mihFontFam, fontPackage: _mihFontPkg);
|
||||
|
||||
static const IconData businessProfile =
|
||||
static const IconData accessControl =
|
||||
IconData(0xe904, fontFamily: _mihFontFam, fontPackage: _mihFontPkg);
|
||||
|
||||
static const IconData businessSetup =
|
||||
static const IconData businessProfile =
|
||||
IconData(0xe905, fontFamily: _mihFontFam, fontPackage: _mihFontPkg);
|
||||
|
||||
static const IconData iDontKnow =
|
||||
static const IconData businessSetup =
|
||||
IconData(0xe906, fontFamily: _mihFontFam, fontPackage: _mihFontPkg);
|
||||
|
||||
static const IconData mihLogo =
|
||||
static const IconData calculator =
|
||||
IconData(0xe907, fontFamily: _mihFontFam, fontPackage: _mihFontPkg);
|
||||
|
||||
static const IconData mihRing =
|
||||
static const IconData calendar =
|
||||
IconData(0xe908, fontFamily: _mihFontFam, fontPackage: _mihFontPkg);
|
||||
|
||||
static const IconData mzansiAi =
|
||||
static const IconData iDontKnow =
|
||||
IconData(0xe909, fontFamily: _mihFontFam, fontPackage: _mihFontPkg);
|
||||
|
||||
static const IconData mzansiWallet =
|
||||
static const IconData mihLogo =
|
||||
IconData(0xe90a, fontFamily: _mihFontFam, fontPackage: _mihFontPkg);
|
||||
|
||||
static const IconData notifications =
|
||||
static const IconData mihRing =
|
||||
IconData(0xe90b, fontFamily: _mihFontFam, fontPackage: _mihFontPkg);
|
||||
|
||||
static const IconData patientManager =
|
||||
static const IconData mzansiAi =
|
||||
IconData(0xe90c, fontFamily: _mihFontFam, fontPackage: _mihFontPkg);
|
||||
|
||||
static const IconData patientProfile =
|
||||
static const IconData mzansiWallet =
|
||||
IconData(0xe90d, fontFamily: _mihFontFam, fontPackage: _mihFontPkg);
|
||||
|
||||
static const IconData profileSetup =
|
||||
static const IconData notifications =
|
||||
IconData(0xe90e, fontFamily: _mihFontFam, fontPackage: _mihFontPkg);
|
||||
|
||||
static const IconData calculator =
|
||||
IconData(0xe940, fontFamily: _mihFontFam, fontPackage: _mihFontPkg);
|
||||
static const IconData patientManager =
|
||||
IconData(0xe90f, fontFamily: _mihFontFam, fontPackage: _mihFontPkg);
|
||||
|
||||
static const IconData calendar =
|
||||
IconData(0xe953, fontFamily: _mihFontFam, fontPackage: _mihFontPkg);
|
||||
static const IconData patientProfile =
|
||||
IconData(0xe910, fontFamily: _mihFontFam, fontPackage: _mihFontPkg);
|
||||
|
||||
static const IconData profileSetup =
|
||||
IconData(0xe911, fontFamily: _mihFontFam, fontPackage: _mihFontPkg);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'dart:io';
|
||||
|
||||
import 'package:file_picker/file_picker.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:ken_logger/ken_logger.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
|
||||
@@ -32,19 +33,9 @@ class _MihImageDisplayState extends State<MihImageDisplay> {
|
||||
late ImageProvider<Object>? imagePreview;
|
||||
|
||||
ImageProvider<Object>? getImage() {
|
||||
Color dark = const Color(0XFF3A4454);
|
||||
KenLogger.success(widget.imageFile.toString());
|
||||
if (widget.imageFile == null) {
|
||||
if (MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark") ==
|
||||
dark) {
|
||||
print("here in light icon");
|
||||
return const AssetImage(
|
||||
'lib/mih_components/mih_package_components/assets/images/i-dont-know-dark.png');
|
||||
} else {
|
||||
print("here in dark icon");
|
||||
return const AssetImage(
|
||||
'lib/mih_components/mih_package_components/assets/images/i-dont-know-light.png');
|
||||
}
|
||||
return null;
|
||||
} else {
|
||||
return widget.imageFile;
|
||||
}
|
||||
@@ -69,9 +60,25 @@ class _MihImageDisplayState extends State<MihImageDisplay> {
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
ClipRRect(
|
||||
imagePreview != null
|
||||
? ClipRRect(
|
||||
borderRadius: BorderRadius.circular(widget.width * 0.1),
|
||||
child: Image(image: imagePreview!),
|
||||
)
|
||||
: Container(
|
||||
width: widget.width,
|
||||
height: widget.height,
|
||||
decoration: BoxDecoration(
|
||||
color: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
borderRadius: BorderRadius.circular(widget.width * 0.1),
|
||||
),
|
||||
child: Icon(
|
||||
Icons.image_not_supported_rounded,
|
||||
size: widget.width * 0.3,
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible: widget.editable,
|
||||
@@ -133,7 +140,7 @@ class _MihImageDisplayState extends State<MihImageDisplay> {
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
print("Error: $e");
|
||||
print("here 2 Error: $e");
|
||||
}
|
||||
},
|
||||
icon: const Icon(
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
@@ -34,7 +35,7 @@ class _MihPackageAlertState extends State<MihPackageAlert> {
|
||||
setState(() {
|
||||
popUpWidth = (size!.width / 4) * 2;
|
||||
popUpheight = null;
|
||||
popUpTitleSize = 25.0;
|
||||
popUpTitleSize = 30.0;
|
||||
popUpSubtitleSize = 20.0;
|
||||
popUpBodySize = 15;
|
||||
popUpPaddingSize = 25.0;
|
||||
@@ -44,7 +45,7 @@ class _MihPackageAlertState extends State<MihPackageAlert> {
|
||||
setState(() {
|
||||
popUpWidth = size!.width - (size!.width * 0.1);
|
||||
popUpheight = null;
|
||||
popUpTitleSize = 20.0;
|
||||
popUpTitleSize = 25.0;
|
||||
popUpSubtitleSize = 18.0;
|
||||
popUpBodySize = 15;
|
||||
popUpPaddingSize = 15.0;
|
||||
@@ -99,7 +100,7 @@ class _MihPackageAlertState extends State<MihPackageAlert> {
|
||||
height: 50,
|
||||
child: IconButton(
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
context.pop();
|
||||
},
|
||||
icon: Icon(
|
||||
Icons.close,
|
||||
|
||||
@@ -191,7 +191,9 @@ class _MihTextFormFieldState extends State<MihTextFormField> {
|
||||
),
|
||||
decoration: InputDecoration(
|
||||
suffixIcon: widget.passwordMode == true
|
||||
? IconButton(
|
||||
? FocusScope(
|
||||
canRequestFocus: false,
|
||||
child: IconButton(
|
||||
icon: Icon(
|
||||
_obscureText
|
||||
? Icons.visibility_off
|
||||
@@ -203,6 +205,7 @@ class _MihTextFormFieldState extends State<MihTextFormField> {
|
||||
_obscureText = !_obscureText;
|
||||
});
|
||||
},
|
||||
),
|
||||
)
|
||||
: null,
|
||||
errorStyle: const TextStyle(
|
||||
|
||||
@@ -8,6 +8,7 @@ class MihToggle extends StatefulWidget {
|
||||
final Color fillColor;
|
||||
final Color secondaryFillColor;
|
||||
final bool? readOnly;
|
||||
final double? elevation;
|
||||
final void Function(bool) onChange;
|
||||
const MihToggle({
|
||||
super.key,
|
||||
@@ -16,6 +17,7 @@ class MihToggle extends StatefulWidget {
|
||||
required this.fillColor,
|
||||
required this.secondaryFillColor,
|
||||
this.readOnly,
|
||||
this.elevation,
|
||||
required this.onChange,
|
||||
});
|
||||
|
||||
@@ -59,7 +61,27 @@ class _MihToggleState extends State<MihToggle> {
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Switch(
|
||||
// Material(
|
||||
// elevation: widget.elevation ?? 0.01,
|
||||
// shadowColor: widget.secondaryFillColor.withOpacity(0.5),
|
||||
// color: Colors.transparent,
|
||||
// shape: StadiumBorder(),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.transparent,
|
||||
borderRadius: BorderRadius.circular(
|
||||
30), // Adjust the border radius to match the toggle
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.15),
|
||||
offset: Offset(
|
||||
0, widget.elevation ?? 10), // Adjust the vertical offset
|
||||
blurRadius: widget.elevation ?? 10,
|
||||
spreadRadius: 0,
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Switch(
|
||||
value: togglePosition,
|
||||
trackOutlineColor: WidgetStateProperty.resolveWith<Color?>(
|
||||
(states) {
|
||||
@@ -76,14 +98,16 @@ class _MihToggleState extends State<MihToggle> {
|
||||
"Dark"); // Outline color when active
|
||||
},
|
||||
),
|
||||
activeColor:
|
||||
widget.readOnly == true ? Colors.grey : widget.secondaryFillColor,
|
||||
activeColor: widget.readOnly == true
|
||||
? Colors.grey
|
||||
: widget.secondaryFillColor,
|
||||
activeTrackColor: widget.readOnly == true
|
||||
? Colors.grey.shade400
|
||||
: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
inactiveThumbColor:
|
||||
widget.readOnly == true ? Colors.grey : widget.secondaryFillColor,
|
||||
inactiveThumbColor: widget.readOnly == true
|
||||
? Colors.grey
|
||||
: widget.secondaryFillColor,
|
||||
inactiveTrackColor: widget.readOnly == true
|
||||
? Colors.grey.shade400
|
||||
: MihColors.getRedColor(
|
||||
@@ -102,6 +126,8 @@ class _MihToggleState extends State<MihToggle> {
|
||||
}
|
||||
: null,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
|
||||
class AboutMihProvider extends ChangeNotifier {
|
||||
int toolIndex;
|
||||
|
||||
AboutMihProvider({
|
||||
this.toolIndex = 0,
|
||||
});
|
||||
|
||||
void reset() {
|
||||
toolIndex = 0;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setToolIndex(int index) {
|
||||
toolIndex = index;
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_objects/patient_access.dart';
|
||||
|
||||
class MihAccessControllsProvider extends ChangeNotifier {
|
||||
int toolIndex;
|
||||
List<PatientAccess>? accessList;
|
||||
|
||||
MihAccessControllsProvider({
|
||||
this.toolIndex = 0,
|
||||
});
|
||||
|
||||
void reset() {
|
||||
toolIndex = 0;
|
||||
accessList = null;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setToolIndex(int index) {
|
||||
toolIndex = index;
|
||||
}
|
||||
|
||||
void setAccessList(List<PatientAccess> accesses) {
|
||||
accessList = accesses;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void editAccessItem(PatientAccess updatedAccess) {
|
||||
if (accessList == null) return;
|
||||
int index = accessList!.indexWhere((access) =>
|
||||
access.app_id == updatedAccess.app_id &&
|
||||
access.business_id == updatedAccess.business_id);
|
||||
if (index != -1) {
|
||||
accessList![index] = updatedAccess;
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
|
||||
class MihAuthenticationProvider extends ChangeNotifier {
|
||||
int toolIndex;
|
||||
|
||||
MihAuthenticationProvider({
|
||||
this.toolIndex = 0,
|
||||
});
|
||||
|
||||
void reset() {
|
||||
toolIndex = 0;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setToolIndex(int index) {
|
||||
toolIndex = index;
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:google_mobile_ads/google_mobile_ads.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_env.dart';
|
||||
|
||||
class MihBannerAdProvider extends ChangeNotifier {
|
||||
BannerAd? bannerAd;
|
||||
final adUnitId = AppEnviroment.bannerAdUnitId;
|
||||
bool isBannerAdLoaded = false;
|
||||
String errorMessage = '';
|
||||
|
||||
MihBannerAdProvider({
|
||||
this.bannerAd,
|
||||
this.isBannerAdLoaded = false,
|
||||
this.errorMessage = '',
|
||||
});
|
||||
|
||||
void reset() {
|
||||
bannerAd = null;
|
||||
isBannerAdLoaded = false;
|
||||
errorMessage = "";
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
bannerAd?.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
void loadBannerAd() {
|
||||
if (bannerAd != null) {
|
||||
bannerAd!.dispose();
|
||||
bannerAd = null;
|
||||
isBannerAdLoaded = false;
|
||||
}
|
||||
bannerAd = BannerAd(
|
||||
adUnitId: adUnitId,
|
||||
request: const AdRequest(),
|
||||
size: AdSize.banner,
|
||||
listener: BannerAdListener(
|
||||
onAdLoaded: (ad) {
|
||||
debugPrint('$ad loaded.');
|
||||
isBannerAdLoaded = true;
|
||||
notifyListeners();
|
||||
},
|
||||
onAdFailedToLoad: (ad, err) {
|
||||
debugPrint('BannerAd failed to load: $err');
|
||||
errorMessage =
|
||||
'Failed to load ad- Message: ${err.message} Code :${err.code}';
|
||||
ad.dispose(); // Dispose the ad to free resources
|
||||
isBannerAdLoaded = false; // ⬅️ Explicitly set to false
|
||||
bannerAd = null; // ⬅️ Explicitly set to null
|
||||
notifyListeners();
|
||||
},
|
||||
onAdOpened: (Ad ad) => debugPrint('$ad opened.'),
|
||||
onAdClosed: (Ad ad) => debugPrint('$ad closed.'),
|
||||
onAdImpression: (Ad ad) => debugPrint('$ad impression.'),
|
||||
),
|
||||
);
|
||||
bannerAd!.load();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
|
||||
class MihCalculatorProvider extends ChangeNotifier {
|
||||
List<String> availableCurrencies;
|
||||
int toolIndex;
|
||||
|
||||
MihCalculatorProvider({
|
||||
this.availableCurrencies = const [],
|
||||
this.toolIndex = 0,
|
||||
});
|
||||
|
||||
void reset() {
|
||||
availableCurrencies = [];
|
||||
toolIndex = 0;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setToolIndex(int index) {
|
||||
toolIndex = index;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setAvailableCurrencies({required List<String> currencies}) async {
|
||||
availableCurrencies = currencies;
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:ken_logger/ken_logger.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_objects/appointment.dart';
|
||||
|
||||
class MihCalendarProvider extends ChangeNotifier {
|
||||
int toolIndex;
|
||||
String selectedDay = DateTime.now().toString().split(" ")[0];
|
||||
List<Appointment>? personalAppointments;
|
||||
List<Appointment>? businessAppointments;
|
||||
|
||||
MihCalendarProvider({
|
||||
this.toolIndex = 0,
|
||||
});
|
||||
|
||||
void reset() {
|
||||
toolIndex = 0;
|
||||
personalAppointments = null;
|
||||
businessAppointments = null;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setToolIndex(int index) {
|
||||
toolIndex = index;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setSelectedDay(String day) {
|
||||
selectedDay = day;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void resetSelectedDay() {
|
||||
selectedDay = DateTime.now().toString().split(" ")[0];
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setPersonalAppointments({required List<Appointment> appointments}) {
|
||||
personalAppointments = appointments;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setBusinessAppointments({required List<Appointment> appointments}) {
|
||||
businessAppointments = appointments;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void addPersonalAppointment({required Appointment newAppointment}) {
|
||||
personalAppointments?.add(newAppointment);
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void addBusinessAppointment({required Appointment newAppointment}) {
|
||||
businessAppointments?.add(newAppointment);
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void editPersonalAppointment({required Appointment updatedAppointment}) {
|
||||
int index = personalAppointments?.indexWhere((appointment) =>
|
||||
appointment.idappointments == updatedAppointment.idappointments) ??
|
||||
-1;
|
||||
KenLogger.success("Edit Patient Index: $index");
|
||||
if (index != -1) {
|
||||
personalAppointments?[index] = updatedAppointment;
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
|
||||
void editBusinessAppointment({required Appointment updatedAppointment}) {
|
||||
int index = businessAppointments?.indexWhere((appointment) =>
|
||||
appointment.idappointments == updatedAppointment.idappointments) ??
|
||||
-1;
|
||||
if (index != -1) {
|
||||
businessAppointments?[index] = updatedAppointment;
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
|
||||
void deletePersonalAppointment({required int appointmentId}) {
|
||||
personalAppointments?.removeWhere(
|
||||
(appointment) => appointment.idappointments == appointmentId);
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void deleteBusinessAppointment({required int appointmentId}) {
|
||||
businessAppointments?.removeWhere(
|
||||
(appointment) => appointment.idappointments == appointmentId);
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_objects/minesweeper_player_score.dart';
|
||||
|
||||
class MihMineSweeperProvider extends ChangeNotifier {
|
||||
String difficulty;
|
||||
int toolIndex;
|
||||
int rowCount;
|
||||
int columnCount;
|
||||
int totalMines;
|
||||
List<MinesweeperPlayerScore>? leaderboard;
|
||||
List<MinesweeperPlayerScore>? myScoreboard;
|
||||
List<ImageProvider<Object>?> leaderboardUserPictures = [];
|
||||
|
||||
MihMineSweeperProvider({
|
||||
this.difficulty = "Easy",
|
||||
this.toolIndex = 0,
|
||||
this.rowCount = 10,
|
||||
this.columnCount = 10,
|
||||
this.totalMines = 15,
|
||||
});
|
||||
|
||||
void reset() {
|
||||
difficulty = "Easy";
|
||||
toolIndex = 0;
|
||||
rowCount = 10;
|
||||
columnCount = 10;
|
||||
totalMines = 15;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setDifficulty(String difficulty) {
|
||||
this.difficulty = difficulty;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setToolIndex(int index) {
|
||||
toolIndex = index;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setRowCount(int rowCount) {
|
||||
this.rowCount = rowCount;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setCoulmnCount(int columnCount) {
|
||||
this.columnCount = columnCount;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setTotalMines(int totalMines) {
|
||||
this.totalMines = totalMines;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setLeaderboard({required List<MinesweeperPlayerScore>? leaderboard}) {
|
||||
if (leaderboard == null) {
|
||||
this.leaderboard = [];
|
||||
} else {
|
||||
this.leaderboard = leaderboard;
|
||||
}
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setMyScoreboard({
|
||||
required List<MinesweeperPlayerScore>? myScoreboard,
|
||||
}) {
|
||||
if (myScoreboard == null) {
|
||||
this.myScoreboard = [];
|
||||
} else {
|
||||
this.myScoreboard = myScoreboard;
|
||||
}
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setLeaderboardUserPictures(
|
||||
{required List<ImageProvider<Object>?> leaderboardUserPictures}) {
|
||||
this.leaderboardUserPictures = leaderboardUserPictures;
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class MzansiAiProvider extends ChangeNotifier {
|
||||
int toolIndex;
|
||||
String? startUpQuestion;
|
||||
|
||||
MzansiAiProvider({
|
||||
this.toolIndex = 0,
|
||||
});
|
||||
|
||||
void reset() {
|
||||
toolIndex = 0;
|
||||
startUpQuestion = null;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setToolIndex(int index) {
|
||||
toolIndex = index;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setStartUpQuestion(String? question) {
|
||||
startUpQuestion = question;
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:geolocator/geolocator.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_objects/app_user.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_objects/bookmarked_business.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_objects/business.dart';
|
||||
|
||||
class MzansiDirectoryProvider extends ChangeNotifier {
|
||||
int toolIndex;
|
||||
Position? userPosition;
|
||||
String userLocation;
|
||||
bool personalSearch;
|
||||
List<BookmarkedBusiness> bookmarkedBusinesses = [];
|
||||
List<Business>? favouriteBusinessesList;
|
||||
List<Business>? searchedBusinesses;
|
||||
Business? selectedBusiness;
|
||||
List<AppUser>? searchedUsers;
|
||||
AppUser? selectedUser;
|
||||
String searchTerm;
|
||||
String businessTypeFilter;
|
||||
|
||||
MzansiDirectoryProvider({
|
||||
this.toolIndex = 0,
|
||||
this.personalSearch = true,
|
||||
this.userLocation = "Unknown Location",
|
||||
this.searchTerm = "",
|
||||
this.businessTypeFilter = "",
|
||||
});
|
||||
|
||||
void reset() {
|
||||
toolIndex = 0;
|
||||
userPosition = null;
|
||||
userLocation = "Unknown Location";
|
||||
personalSearch = true;
|
||||
bookmarkedBusinesses = [];
|
||||
searchedBusinesses = null;
|
||||
selectedBusiness = null;
|
||||
searchedUsers = null;
|
||||
selectedUser = null;
|
||||
searchTerm = "";
|
||||
businessTypeFilter = "";
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setToolIndex(int index) {
|
||||
toolIndex = index;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setUserPosition(Position? position) {
|
||||
userPosition = position;
|
||||
if (position == null) {
|
||||
userLocation = "Unknown Location";
|
||||
} else {
|
||||
userLocation = "${position.latitude}, ${position.longitude}";
|
||||
}
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setPersonalSearch(bool personal) {
|
||||
personalSearch = personal;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setBookmarkedeBusinesses(
|
||||
{required List<BookmarkedBusiness> businesses}) {
|
||||
bookmarkedBusinesses = businesses;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setFavouriteBusinesses({required List<Business> businesses}) {
|
||||
favouriteBusinessesList = businesses;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setSearchedBusinesses({required List<Business> searchedBusinesses}) {
|
||||
this.searchedBusinesses = searchedBusinesses;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setSelectedBusiness({required Business business}) {
|
||||
selectedBusiness = business;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setSearchedUsers({required List<AppUser> searchedUsers}) {
|
||||
this.searchedUsers = searchedUsers;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setSelectedUser({required AppUser user}) {
|
||||
selectedUser = user;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setSearchTerm({required String searchTerm}) {
|
||||
this.searchTerm = searchTerm;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setBusinessTypeFilter({required String businessTypeFilter}) {
|
||||
this.businessTypeFilter = businessTypeFilter;
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,141 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_objects/app_user.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_objects/business.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_objects/business_employee.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_objects/business_user.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_objects/user_consent.dart';
|
||||
|
||||
class MzansiProfileProvider extends ChangeNotifier {
|
||||
bool personalHome;
|
||||
int personalIndex;
|
||||
int businessIndex;
|
||||
AppUser? user;
|
||||
String? userProfilePicUrl;
|
||||
ImageProvider<Object>? userProfilePicture;
|
||||
Business? business;
|
||||
String? businessProfilePicUrl;
|
||||
ImageProvider<Object>? businessProfilePicture;
|
||||
BusinessUser? businessUser;
|
||||
String? businessUserSignatureUrl;
|
||||
ImageProvider<Object>? businessUserSignature;
|
||||
UserConsent? userConsent;
|
||||
List<BusinessEmployee>? employeeList;
|
||||
List<AppUser> userSearchResults = [];
|
||||
|
||||
MzansiProfileProvider({
|
||||
this.personalHome = true,
|
||||
this.personalIndex = 0,
|
||||
this.businessIndex = 0,
|
||||
});
|
||||
|
||||
void reset() {
|
||||
personalHome = true;
|
||||
personalIndex = 0;
|
||||
businessIndex = 0;
|
||||
user = null;
|
||||
userProfilePicUrl = null;
|
||||
userProfilePicture = null;
|
||||
business = null;
|
||||
businessProfilePicUrl = null;
|
||||
businessProfilePicture = null;
|
||||
businessUser = null;
|
||||
businessUserSignatureUrl = null;
|
||||
businessUserSignature = null;
|
||||
userConsent = null;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setPersonalHome(bool isPersonalHome) {
|
||||
personalHome = isPersonalHome;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setPersonalIndex(int index) {
|
||||
personalIndex = index;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setBusinessIndex(int index) {
|
||||
businessIndex = index;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setUser({
|
||||
required AppUser newUser,
|
||||
}) {
|
||||
user = newUser;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setUserProfilePicUrl(String url) {
|
||||
userProfilePicUrl = url;
|
||||
userProfilePicture = url.isNotEmpty ? NetworkImage(url) : null;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setBusiness({
|
||||
Business? newBusiness,
|
||||
}) {
|
||||
business = newBusiness;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setBusinessProfilePicUrl(String url) {
|
||||
businessProfilePicUrl = url;
|
||||
businessProfilePicture = url.isNotEmpty ? NetworkImage(url) : null;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setBusinessUser({required BusinessUser newBusinessUser}) {
|
||||
businessUser = newBusinessUser;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setBusinessUserSignatureUrl(String url) {
|
||||
businessUserSignatureUrl = url;
|
||||
businessUserSignature = url.isNotEmpty ? NetworkImage(url) : null;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setUserConsent(UserConsent? newUserConsent) {
|
||||
userConsent = newUserConsent;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setEmployeeList({required List<BusinessEmployee> employeeList}) {
|
||||
this.employeeList = employeeList;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void addLoyaltyCard({required BusinessEmployee newEmployee}) {
|
||||
employeeList!.add(newEmployee);
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void updateEmplyeeDetails({required BusinessEmployee updatedEmployee}) {
|
||||
int index = employeeList!.indexWhere((employee) =>
|
||||
employee.business_id == updatedEmployee.business_id &&
|
||||
employee.app_id == updatedEmployee.app_id);
|
||||
if (index != -1) {
|
||||
employeeList![index] = updatedEmployee;
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
|
||||
void deleteEmplyee({required BusinessEmployee deletedEmployee}) {
|
||||
employeeList!.removeWhere((employee) =>
|
||||
employee.business_id == deletedEmployee.business_id &&
|
||||
employee.app_id == deletedEmployee.app_id);
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void addEmployee({required BusinessEmployee newEmployee}) {
|
||||
employeeList!.add(newEmployee);
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setUserearchResults({required List<AppUser> userSearchResults}) {
|
||||
this.userSearchResults = userSearchResults;
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_objects/loyalty_card.dart';
|
||||
|
||||
class MzansiWalletProvider extends ChangeNotifier {
|
||||
List<MIHLoyaltyCard> loyaltyCards;
|
||||
List<MIHLoyaltyCard> favouriteCards;
|
||||
int toolIndex;
|
||||
|
||||
MzansiWalletProvider({
|
||||
this.loyaltyCards = const [],
|
||||
this.favouriteCards = const [],
|
||||
this.toolIndex = 0,
|
||||
});
|
||||
|
||||
void reset() {
|
||||
toolIndex = 0;
|
||||
loyaltyCards = [];
|
||||
favouriteCards = [];
|
||||
}
|
||||
|
||||
void setToolIndex(int index) {
|
||||
toolIndex = index;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setLoyaltyCards({required List<MIHLoyaltyCard> cards}) async {
|
||||
loyaltyCards = cards;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setFavouriteCards({required List<MIHLoyaltyCard> cards}) async {
|
||||
favouriteCards = cards;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void deleteLoyaltyCard({required int cardId}) {
|
||||
loyaltyCards.removeWhere((card) => card.idloyalty_cards == cardId);
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void editLoyaltyCard({required MIHLoyaltyCard updatedCard}) {
|
||||
int index = loyaltyCards.indexWhere(
|
||||
(card) => card.idloyalty_cards == updatedCard.idloyalty_cards);
|
||||
if (index != -1) {
|
||||
loyaltyCards[index] = updatedCard;
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_objects/claim_statement_file.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_objects/files.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_objects/notes.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_objects/patient_access.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_objects/patients.dart';
|
||||
|
||||
class PatientManagerProvider extends ChangeNotifier {
|
||||
int patientProfileIndex;
|
||||
int patientManagerIndex;
|
||||
int fileViewerIndex;
|
||||
bool personalMode;
|
||||
List<PatientAccess>? myPaitentList;
|
||||
Patient? selectedPatient;
|
||||
List<Note>? consultationNotes;
|
||||
List<PFile>? patientDocuments;
|
||||
List<ClaimStatementFile>? patientClaimsDocuments;
|
||||
List<Patient> patientSearchResults = [];
|
||||
|
||||
PatientManagerProvider({
|
||||
this.patientProfileIndex = 0,
|
||||
this.patientManagerIndex = 0,
|
||||
this.fileViewerIndex = 0,
|
||||
this.personalMode = true,
|
||||
});
|
||||
|
||||
void reset() {
|
||||
patientProfileIndex = 0;
|
||||
patientManagerIndex = 0;
|
||||
personalMode = true;
|
||||
selectedPatient = null;
|
||||
}
|
||||
|
||||
void setPatientProfileIndex(int index) {
|
||||
patientProfileIndex = index;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setPatientManagerIndex(int index) {
|
||||
patientManagerIndex = index;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setFileViewerIndex(int index) {
|
||||
patientProfileIndex = index;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setPersonalMode(bool personalMode) {
|
||||
this.personalMode = personalMode;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setSelectedPatient({required Patient? selectedPatient}) {
|
||||
this.selectedPatient = selectedPatient;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setMyPatientList({required List<PatientAccess>? myPaitentList}) {
|
||||
this.myPaitentList = myPaitentList ?? [];
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setConsultationNotes({required List<Note>? consultationNotes}) {
|
||||
this.consultationNotes = consultationNotes ?? [];
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setPatientDocuments({required List<PFile>? patientDocuments}) {
|
||||
this.patientDocuments = patientDocuments ?? [];
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setClaimsDocuments(
|
||||
{required List<ClaimStatementFile>? patientClaimsDocuments}) {
|
||||
this.patientClaimsDocuments = patientClaimsDocuments ?? [];
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setPatientSearchResults({required List<Patient> patientSearchResults}) {
|
||||
this.patientSearchResults = patientSearchResults;
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
@@ -37,7 +37,7 @@ class MihColors {
|
||||
if (darkMode == true) {
|
||||
return const Color(0xff8ae290);
|
||||
} else {
|
||||
return const Color(0xffB0F2B4);
|
||||
return const Color(0xFF41B349);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ class MihColors {
|
||||
return const Color(0xffd69d7d);
|
||||
} else {
|
||||
// Add a different shade of pink for light mode
|
||||
return const Color(0xffd69d7d);
|
||||
return const Color(0xFFBD7145);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ class MihColors {
|
||||
return const Color(0xff6e7dcc);
|
||||
} else {
|
||||
// Add a different shade of pink for light mode
|
||||
return const Color(0xff6e7dcc);
|
||||
return const Color(0xFF5567C0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,7 +90,34 @@ class MihColors {
|
||||
return const Color(0xffb682e7);
|
||||
} else {
|
||||
// Add a different shade of pink for light mode
|
||||
return const Color(0xffb682e7);
|
||||
return const Color(0xFF9857D4);
|
||||
}
|
||||
}
|
||||
|
||||
static Color getGoldColor(bool darkMode) {
|
||||
if (darkMode == true) {
|
||||
return const Color(0xFFD4AF37);
|
||||
} else {
|
||||
// Add a different shade of pink for light mode
|
||||
return const Color(0xffFFD700);
|
||||
}
|
||||
}
|
||||
|
||||
static Color getSilverColor(bool darkMode) {
|
||||
if (darkMode == true) {
|
||||
return const Color(0xffC0C0C0);
|
||||
} else {
|
||||
// Add a different shade of pink for light mode
|
||||
return const Color(0xFFA6A6A6);
|
||||
}
|
||||
}
|
||||
|
||||
static Color getBronze(bool darkMode) {
|
||||
if (darkMode == true) {
|
||||
return const Color(0xffB1560F);
|
||||
} else {
|
||||
// Add a different shade of pink for light mode
|
||||
return const Color(0xFFCD7F32);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_print_prevew.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_objects/app_user.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_objects/arguments.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/Example/package_test.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_providers/mzansi_directory_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_providers/mzansi_profile_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/about_mih/about_mih.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/access_review/mih_access.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/calculator/mih_calculator.dart';
|
||||
@@ -13,21 +14,22 @@ import 'package:mzansi_innovation_hub/mih_packages/mih_authentication/mih_auth_p
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mih_authentication/mih_authentication.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mih_home/mih_home.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mih_home/mih_route_error.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mine_sweeper/mih_mine_sweeper.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mzansi_ai/mzansi_ai.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mzansi_directory/mzansi_directory.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mzansi_profile/business_profile/mzansi_business_profile.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mzansi_profile/business_profile/busines_profile.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mzansi_profile/business_profile/mzansi_business_profile_view.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mzansi_profile/business_profile/profile_business_add.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mzansi_profile/business_profile/mzansi_set_up_business_profile.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mzansi_profile/personal_profile/mzansi_profile.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mzansi_profile/personal_profile/mzansi_profile_view.dart';
|
||||
import 'package:ken_logger/ken_logger.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mzansi_wallet/components/mih_barcode_scanner.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mzansi_wallet/mih_wallet.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/patient_profile/pat_manager/pat_manager.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/patient_profile/pat_profile/add_or_view_patient.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/patient_profile/pat_profile/components/full_screen_file.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/patient_profile/pat_profile/patient_edit.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/patient_profile/pat_profile/patient_profile.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/patient_manager/pat_manager/pat_manager.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/patient_manager/pat_profile/components/full_screen_file.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/patient_manager/pat_profile/patient_profile.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/patient_manager/pat_profile/patient_set_up.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:supertokens_flutter/supertokens.dart';
|
||||
|
||||
class MihGoRouterPaths {
|
||||
@@ -50,7 +52,6 @@ class MihGoRouterPaths {
|
||||
static const String businessProfileView = '/business-profile/view';
|
||||
static const String patientProfile = '/patient-profile';
|
||||
static const String patientProfileSetup = '/patient-profile/set-up';
|
||||
static const String patientProfileEdit = '/patient-profile/edit';
|
||||
static const String mzansiWallet = '/mzansi-wallet';
|
||||
static const String mzansiDirectory = '/mzansi-directory';
|
||||
static const String mihAccess = '/mih-access';
|
||||
@@ -63,6 +64,7 @@ class MihGoRouterPaths {
|
||||
static const String barcodeScanner = '/scanner';
|
||||
static const String calculator = '/calculator';
|
||||
static const String mzansiAi = '/mzansi-ai';
|
||||
static const String mihMineSweeper = '/mih-minesweeper';
|
||||
static const String packageDevTest = '/package-dev';
|
||||
}
|
||||
|
||||
@@ -131,16 +133,8 @@ class MihGoRouter {
|
||||
path: MihGoRouterPaths.mihHome,
|
||||
builder: (BuildContext context, GoRouterState state) {
|
||||
KenLogger.success("MihGoRouter: mihHome");
|
||||
if (state.extra != null) {
|
||||
final bool personalSelected = state.extra as bool;
|
||||
return MihHome(
|
||||
key: UniqueKey(),
|
||||
personalSelected: personalSelected,
|
||||
);
|
||||
}
|
||||
return MihHome(
|
||||
key: UniqueKey(),
|
||||
personalSelected: true,
|
||||
);
|
||||
},
|
||||
),
|
||||
@@ -150,14 +144,7 @@ class MihGoRouter {
|
||||
path: MihGoRouterPaths.aboutMih,
|
||||
builder: (BuildContext context, GoRouterState state) {
|
||||
KenLogger.success("MihGoRouter: aboutMih");
|
||||
final AboutArguments? args = state.extra as AboutArguments?;
|
||||
int index = 0;
|
||||
bool personalSelected = true;
|
||||
if (args != null) {
|
||||
index = args.packageIndex ?? 0;
|
||||
personalSelected = args.personalSelected;
|
||||
}
|
||||
return AboutMih(arguments: AboutArguments(personalSelected, index));
|
||||
return AboutMih();
|
||||
},
|
||||
),
|
||||
// ========================== Mzansi Profile Personal ==================================
|
||||
@@ -166,15 +153,13 @@ class MihGoRouter {
|
||||
path: MihGoRouterPaths.mzansiProfileManage,
|
||||
builder: (BuildContext context, GoRouterState state) {
|
||||
KenLogger.success("MihGoRouter: mzansiProfileManage");
|
||||
final AppProfileUpdateArguments? args =
|
||||
state.extra as AppProfileUpdateArguments?;
|
||||
if (args == null) {
|
||||
if (context.watch<MzansiProfileProvider>().user == null) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
context.go(MihGoRouterPaths.mihHome);
|
||||
});
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
return MzansiProfile(arguments: args);
|
||||
return MzansiProfile();
|
||||
},
|
||||
),
|
||||
GoRoute(
|
||||
@@ -182,14 +167,15 @@ class MihGoRouter {
|
||||
path: MihGoRouterPaths.mzansiProfileView,
|
||||
builder: (BuildContext context, GoRouterState state) {
|
||||
KenLogger.success("MihGoRouter: mzansiProfileView");
|
||||
final AppUser? user = state.extra as AppUser?;
|
||||
if (user == null) {
|
||||
MzansiDirectoryProvider directoryProvider =
|
||||
context.read<MzansiDirectoryProvider>();
|
||||
if (directoryProvider.selectedUser == null) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
context.go(MihGoRouterPaths.mihHome);
|
||||
});
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
return MzansiProfileView(user: user);
|
||||
return MzansiProfileView();
|
||||
},
|
||||
),
|
||||
// ========================== Mzansi Profile Business ==================================
|
||||
@@ -198,17 +184,16 @@ class MihGoRouter {
|
||||
path: MihGoRouterPaths.businessProfileManage,
|
||||
builder: (BuildContext context, GoRouterState state) {
|
||||
KenLogger.success("MihGoRouter: businessProfileManage");
|
||||
final BusinessArguments? args = state.extra as BusinessArguments?;
|
||||
if (args == null) {
|
||||
if (context.watch<MzansiProfileProvider>().business == null) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
context.go(MihGoRouterPaths.mihHome);
|
||||
});
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
return MzansiBusinessProfile(
|
||||
key: UniqueKey(),
|
||||
arguments: args,
|
||||
);
|
||||
return BusinesProfile();
|
||||
// return MzansiBusinessProfile(
|
||||
// key: UniqueKey(),
|
||||
// );
|
||||
},
|
||||
),
|
||||
GoRoute(
|
||||
@@ -218,9 +203,10 @@ class MihGoRouter {
|
||||
KenLogger.success("MihGoRouter: businessProfileView");
|
||||
String? businessId = state.uri.queryParameters['business_id'];
|
||||
KenLogger.success("businessId: $businessId");
|
||||
final BusinessViewArguments? args =
|
||||
state.extra as BusinessViewArguments?;
|
||||
if (args == null && businessId == null) {
|
||||
MzansiDirectoryProvider directoryProvider =
|
||||
context.read<MzansiDirectoryProvider>();
|
||||
if (directoryProvider.selectedBusiness == null &&
|
||||
businessId == null) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
context.go(MihGoRouterPaths.mihHome);
|
||||
});
|
||||
@@ -228,7 +214,6 @@ class MihGoRouter {
|
||||
}
|
||||
return MzansiBusinessProfileView(
|
||||
key: UniqueKey(),
|
||||
arguments: args,
|
||||
businessId: businessId,
|
||||
);
|
||||
},
|
||||
@@ -238,8 +223,7 @@ class MihGoRouter {
|
||||
path: MihGoRouterPaths.businessProfileSetup,
|
||||
builder: (BuildContext context, GoRouterState state) {
|
||||
KenLogger.success("MihGoRouter: businessProfileSetup");
|
||||
final AppUser? signedInUser = state.extra as AppUser?;
|
||||
return ProfileBusinessAdd(signedInUser: signedInUser!);
|
||||
return MzansiSetUpBusinessProfile();
|
||||
},
|
||||
),
|
||||
// ========================== MIH Calculator ==================================
|
||||
@@ -248,12 +232,7 @@ class MihGoRouter {
|
||||
path: MihGoRouterPaths.calculator,
|
||||
builder: (BuildContext context, GoRouterState state) {
|
||||
KenLogger.success("MihGoRouter: mihCalculator");
|
||||
final bool? personalSelected = state.extra as bool?;
|
||||
bool personal = true;
|
||||
if (personalSelected != null) {
|
||||
personal = personalSelected;
|
||||
}
|
||||
return MIHCalculator(personalSelected: personal);
|
||||
return MIHCalculator();
|
||||
},
|
||||
),
|
||||
// ========================== MIH Calculator ==================================
|
||||
@@ -262,8 +241,7 @@ class MihGoRouter {
|
||||
path: MihGoRouterPaths.calendar,
|
||||
builder: (BuildContext context, GoRouterState state) {
|
||||
KenLogger.success("MihGoRouter: mihCalendar");
|
||||
final CalendarArguments? args = state.extra as CalendarArguments?;
|
||||
if (args == null) {
|
||||
if (context.watch<MzansiProfileProvider>().user == null) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
context.go(MihGoRouterPaths.mihHome);
|
||||
});
|
||||
@@ -271,7 +249,6 @@ class MihGoRouter {
|
||||
}
|
||||
return MzansiCalendar(
|
||||
key: UniqueKey(),
|
||||
arguments: args,
|
||||
);
|
||||
},
|
||||
),
|
||||
@@ -281,14 +258,13 @@ class MihGoRouter {
|
||||
path: MihGoRouterPaths.mzansiAi,
|
||||
builder: (BuildContext context, GoRouterState state) {
|
||||
KenLogger.success("MihGoRouter: mzansiAi");
|
||||
final MzansiAiArguments? args = state.extra as MzansiAiArguments?;
|
||||
if (args == null) {
|
||||
if (context.watch<MzansiProfileProvider>().user == null) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
context.go(MihGoRouterPaths.mihHome);
|
||||
});
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
return MzansiAi(arguments: args);
|
||||
return MzansiAi();
|
||||
},
|
||||
),
|
||||
// ========================== Mzansi Wallet ==================================
|
||||
@@ -297,8 +273,7 @@ class MihGoRouter {
|
||||
path: MihGoRouterPaths.mzansiWallet,
|
||||
builder: (BuildContext context, GoRouterState state) {
|
||||
KenLogger.success("MihGoRouter: mzansiWallet");
|
||||
final WalletArguments? args = state.extra as WalletArguments?;
|
||||
if (args == null) {
|
||||
if (context.watch<MzansiProfileProvider>().user == null) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
context.go(MihGoRouterPaths.mihHome);
|
||||
});
|
||||
@@ -306,7 +281,6 @@ class MihGoRouter {
|
||||
}
|
||||
return MihWallet(
|
||||
key: UniqueKey(),
|
||||
arguments: args,
|
||||
);
|
||||
},
|
||||
),
|
||||
@@ -347,8 +321,8 @@ class MihGoRouter {
|
||||
name: "mihAccess",
|
||||
path: MihGoRouterPaths.mihAccess,
|
||||
builder: (BuildContext context, GoRouterState state) {
|
||||
final AppUser? signedInUser = state.extra as AppUser?;
|
||||
if (signedInUser == null) {
|
||||
KenLogger.success("MihGoRouter: mihAccess");
|
||||
if (context.watch<MzansiProfileProvider>().user == null) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
context.go(MihGoRouterPaths.mihHome);
|
||||
});
|
||||
@@ -356,7 +330,6 @@ class MihGoRouter {
|
||||
}
|
||||
return MihAccess(
|
||||
key: UniqueKey(),
|
||||
signedInUser: signedInUser,
|
||||
);
|
||||
},
|
||||
),
|
||||
@@ -365,44 +338,36 @@ class MihGoRouter {
|
||||
name: "patientProfile",
|
||||
path: MihGoRouterPaths.patientProfile,
|
||||
builder: (BuildContext context, GoRouterState state) {
|
||||
final PatientViewArguments? args =
|
||||
state.extra as PatientViewArguments?;
|
||||
if (args == null) {
|
||||
KenLogger.success("MihGoRouter: patientProfile");
|
||||
if (context.watch<MzansiProfileProvider>().user == null) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
context.go(MihGoRouterPaths.mihHome);
|
||||
});
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
return AddOrViewPatient(
|
||||
key: UniqueKey(),
|
||||
arguments: args,
|
||||
);
|
||||
return PatientProfile();
|
||||
},
|
||||
),
|
||||
GoRoute(
|
||||
name: "patientProfileEdit",
|
||||
path: MihGoRouterPaths.patientProfileEdit,
|
||||
name: "patientProfileSetup",
|
||||
path: MihGoRouterPaths.patientProfileSetup,
|
||||
builder: (BuildContext context, GoRouterState state) {
|
||||
final PatientEditArguments? args =
|
||||
state.extra as PatientEditArguments?;
|
||||
if (args == null) {
|
||||
KenLogger.success("MihGoRouter: patientProfileSetup");
|
||||
if (context.watch<MzansiProfileProvider>().user == null) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
context.go(MihGoRouterPaths.mihHome);
|
||||
});
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
return EditPatient(
|
||||
signedInUser: args.signedInUser,
|
||||
selectedPatient: args.selectedPatient,
|
||||
);
|
||||
return PatientSetUp();
|
||||
},
|
||||
),
|
||||
GoRoute(
|
||||
name: "patientManager",
|
||||
path: MihGoRouterPaths.patientManager,
|
||||
builder: (BuildContext context, GoRouterState state) {
|
||||
final PatManagerArguments? args = state.extra as PatManagerArguments?;
|
||||
if (args == null) {
|
||||
KenLogger.success("MihGoRouter: patientManager");
|
||||
if (context.watch<MzansiProfileProvider>().business == null) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
context.go(MihGoRouterPaths.mihHome);
|
||||
});
|
||||
@@ -410,7 +375,6 @@ class MihGoRouter {
|
||||
}
|
||||
return PatManager(
|
||||
key: UniqueKey(),
|
||||
arguments: args,
|
||||
);
|
||||
},
|
||||
),
|
||||
@@ -418,15 +382,14 @@ class MihGoRouter {
|
||||
name: "patientManagerPatient",
|
||||
path: MihGoRouterPaths.patientManagerPatient,
|
||||
builder: (BuildContext context, GoRouterState state) {
|
||||
final PatientViewArguments? args =
|
||||
state.extra as PatientViewArguments?;
|
||||
if (args == null) {
|
||||
KenLogger.success("MihGoRouter: patientManagerPatient");
|
||||
if (context.watch<MzansiProfileProvider>().user == null) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
context.go(MihGoRouterPaths.mihHome);
|
||||
});
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
return PatientProfile(arguments: args);
|
||||
return PatientProfile();
|
||||
},
|
||||
),
|
||||
// ========================== Mzansi Directory ==================================
|
||||
@@ -434,15 +397,14 @@ class MihGoRouter {
|
||||
name: "mzansiDirectory",
|
||||
path: MihGoRouterPaths.mzansiDirectory,
|
||||
builder: (BuildContext context, GoRouterState state) {
|
||||
final MzansiDirectoryArguments? args =
|
||||
state.extra as MzansiDirectoryArguments?;
|
||||
if (args == null) {
|
||||
KenLogger.success("MihGoRouter: mzansiDirectory");
|
||||
if (context.watch<MzansiProfileProvider>().user == null) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
context.go(MihGoRouterPaths.mihHome);
|
||||
});
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
return MzansiDirectory(arguments: args);
|
||||
return MzansiDirectory();
|
||||
},
|
||||
),
|
||||
// ========================== End ==================================
|
||||
@@ -450,6 +412,7 @@ class MihGoRouter {
|
||||
name: "fileViewer",
|
||||
path: MihGoRouterPaths.fileViewer,
|
||||
builder: (BuildContext context, GoRouterState state) {
|
||||
KenLogger.success("MihGoRouter: fileViewer");
|
||||
final FileViewArguments? args = state.extra as FileViewArguments?;
|
||||
return FullScreenFileViewer(arguments: args!);
|
||||
},
|
||||
@@ -458,11 +421,27 @@ class MihGoRouter {
|
||||
name: "printPreview",
|
||||
path: MihGoRouterPaths.printPreview,
|
||||
builder: (BuildContext context, GoRouterState state) {
|
||||
KenLogger.success("MihGoRouter: printPreview");
|
||||
final PrintPreviewArguments? args =
|
||||
state.extra as PrintPreviewArguments?;
|
||||
return MIHPrintPreview(arguments: args!);
|
||||
},
|
||||
),
|
||||
// ========================== MIH Minesweeper ==================================
|
||||
GoRoute(
|
||||
name: "mihMinesweeper",
|
||||
path: MihGoRouterPaths.mihMineSweeper,
|
||||
builder: (BuildContext context, GoRouterState state) {
|
||||
KenLogger.success("MihGoRouter: mihMineSweeper");
|
||||
if (context.watch<MzansiProfileProvider>().user == null) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
context.go(MihGoRouterPaths.mihHome);
|
||||
});
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
return MihMineSweeper();
|
||||
},
|
||||
),
|
||||
// ========================== End ==================================
|
||||
// GoRoute(
|
||||
// name: "notifications",
|
||||
|
||||
@@ -14,7 +14,7 @@ class MihTheme {
|
||||
late String loadingAssetText;
|
||||
late TargetPlatform platform;
|
||||
bool kIsWeb = const bool.fromEnvironment('dart.library.js_util');
|
||||
String latestVersion = "1.2.0";
|
||||
String latestVersion = "1.2.2";
|
||||
// Options:-
|
||||
// f3f9d2 = Cream
|
||||
// f0f0c9 = cream2
|
||||
|
||||
@@ -1,19 +1,18 @@
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_objects/arguments.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_action.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tools.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_providers/about_mih_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/about_mih/package_tools/mih_%20attributes.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/about_mih/package_tools/mih_info.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/about_mih/package_tools/mih_privacy_policy.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/about_mih/package_tools/mih_terms_of_service.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class AboutMih extends StatefulWidget {
|
||||
final AboutArguments? arguments;
|
||||
const AboutMih({
|
||||
super.key,
|
||||
this.arguments,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -21,21 +20,9 @@ class AboutMih extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _AboutMihState extends State<AboutMih> {
|
||||
late int _selcetedIndex;
|
||||
late bool _personalSelected;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
setState(() {
|
||||
if (widget.arguments == null) {
|
||||
_selcetedIndex = 0;
|
||||
_personalSelected = true;
|
||||
} else {
|
||||
_selcetedIndex = widget.arguments!.packageIndex!;
|
||||
_personalSelected = widget.arguments!.personalSelected;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -45,12 +32,9 @@ class _AboutMihState extends State<AboutMih> {
|
||||
appTools: getTools(),
|
||||
appBody: getToolBody(),
|
||||
appToolTitles: getToolTitle(),
|
||||
selectedbodyIndex: _selcetedIndex,
|
||||
onIndexChange: (newValue) {
|
||||
setState(() {
|
||||
_selcetedIndex = newValue;
|
||||
});
|
||||
// print("Index: $_selcetedIndex");
|
||||
selectedbodyIndex: context.watch<AboutMihProvider>().toolIndex,
|
||||
onIndexChange: (newIndex) {
|
||||
context.read<AboutMihProvider>().setToolIndex(newIndex);
|
||||
},
|
||||
);
|
||||
}
|
||||
@@ -62,7 +46,6 @@ class _AboutMihState extends State<AboutMih> {
|
||||
onTap: () {
|
||||
context.goNamed(
|
||||
'mihHome',
|
||||
extra: _personalSelected,
|
||||
);
|
||||
FocusScope.of(context).unfocus();
|
||||
},
|
||||
@@ -72,28 +55,20 @@ class _AboutMihState extends State<AboutMih> {
|
||||
MihPackageTools getTools() {
|
||||
Map<Widget, void Function()?> temp = {};
|
||||
temp[const Icon(Icons.info)] = () {
|
||||
setState(() {
|
||||
_selcetedIndex = 0;
|
||||
});
|
||||
context.read<AboutMihProvider>().setToolIndex(0);
|
||||
};
|
||||
temp[const Icon(Icons.policy)] = () {
|
||||
setState(() {
|
||||
_selcetedIndex = 1;
|
||||
});
|
||||
context.read<AboutMihProvider>().setToolIndex(1);
|
||||
};
|
||||
temp[const Icon(Icons.design_services)] = () {
|
||||
setState(() {
|
||||
_selcetedIndex = 2;
|
||||
});
|
||||
context.read<AboutMihProvider>().setToolIndex(2);
|
||||
};
|
||||
temp[const Icon(Icons.star_rounded)] = () {
|
||||
setState(() {
|
||||
_selcetedIndex = 3;
|
||||
});
|
||||
context.read<AboutMihProvider>().setToolIndex(3);
|
||||
};
|
||||
return MihPackageTools(
|
||||
tools: temp,
|
||||
selcetedIndex: _selcetedIndex,
|
||||
selcetedIndex: context.watch<AboutMihProvider>().toolIndex,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_action.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_body.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_header.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_layout_builder.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_objects/arguments.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/about_mih/mih_policy_tos_ext/policy_and_terms_text.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class MIHPrivacyPolocyExternal extends StatefulWidget {
|
||||
const MIHPrivacyPolocyExternal({super.key});
|
||||
|
||||
@override
|
||||
State<MIHPrivacyPolocyExternal> createState() =>
|
||||
_MIHPrivacyPolocyExternalState();
|
||||
}
|
||||
|
||||
class _MIHPrivacyPolocyExternalState extends State<MIHPrivacyPolocyExternal> {
|
||||
MIHAction getActionButton() {
|
||||
return MIHAction(
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
iconSize: 35,
|
||||
onTap: () {
|
||||
Navigator.of(context).pushNamedAndRemoveUntil(
|
||||
'/',
|
||||
arguments: AuthArguments(true, false),
|
||||
(route) => false,
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
MIHHeader getHeader() {
|
||||
return const MIHHeader(
|
||||
headerAlignment: MainAxisAlignment.center,
|
||||
headerItems: [],
|
||||
);
|
||||
}
|
||||
|
||||
MIHBody getBody() {
|
||||
return MIHBody(
|
||||
borderOn: false,
|
||||
bodyItems: PolicyAndTermsText().getPrivacyPolicyText(context),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MIHLayoutBuilder(
|
||||
actionButton: getActionButton(),
|
||||
header: getHeader(),
|
||||
secondaryActionButton: null,
|
||||
body: getBody(),
|
||||
actionDrawer: null,
|
||||
secondaryActionDrawer: null,
|
||||
bottomNavBar: null,
|
||||
pullDownToRefresh: false,
|
||||
onPullDown: () async {},
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_action.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_body.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_header.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_layout_builder.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_objects/arguments.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/about_mih/mih_policy_tos_ext/policy_and_terms_text.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class MIHTermsOfServiceExternal extends StatefulWidget {
|
||||
const MIHTermsOfServiceExternal({super.key});
|
||||
|
||||
@override
|
||||
State<MIHTermsOfServiceExternal> createState() =>
|
||||
_MIHTermsOfServiceExternalState();
|
||||
}
|
||||
|
||||
class _MIHTermsOfServiceExternalState extends State<MIHTermsOfServiceExternal> {
|
||||
MIHAction getActionButton() {
|
||||
return MIHAction(
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
iconSize: 35,
|
||||
onTap: () {
|
||||
Navigator.of(context).pushNamedAndRemoveUntil(
|
||||
'/',
|
||||
arguments: AuthArguments(true, false),
|
||||
(route) => false,
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
MIHHeader getHeader() {
|
||||
return const MIHHeader(
|
||||
headerAlignment: MainAxisAlignment.center,
|
||||
headerItems: [],
|
||||
);
|
||||
}
|
||||
|
||||
MIHBody getBody() {
|
||||
return MIHBody(
|
||||
borderOn: false,
|
||||
bodyItems: PolicyAndTermsText().getTermsOfServiceText(context),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MIHLayoutBuilder(
|
||||
actionButton: getActionButton(),
|
||||
header: getHeader(),
|
||||
secondaryActionButton: null,
|
||||
body: getBody(),
|
||||
actionDrawer: null,
|
||||
secondaryActionDrawer: null,
|
||||
bottomNavBar: null,
|
||||
pullDownToRefresh: false,
|
||||
onPullDown: () async {},
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -4,27 +4,36 @@ import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
|
||||
class PolicyAndTermsText {
|
||||
List<Widget> getPrivacyPolicyText(BuildContext context) {
|
||||
String effectDate = "6 December 2024";
|
||||
String intro =
|
||||
"Mzansi Innovation Hub - MIH (\"we,\" \"our,\" \"us\") values your privacy and is committed to protecting your personal data. This Privacy Policy explains how we collect, use, disclose, and safeguard your information when you use our app, Mzansi Innovation Hub - MIH, available globally.";
|
||||
String infoCollect =
|
||||
"We collect the following personal information to provide and improve our services:\n• Personal Details: Name, ID, address, phone number etc.\n• Medical Information: Medical aid details (if applicable).\n• Loyalty Card Information: Loyalty card numbers for the Mzansi Wallet feature.";
|
||||
String useInfo =
|
||||
"Your personal information is used for the following purposes:\n• To create and manage your account.\n• To facilitate interactions between clients and businesses.\n• To enable the storage of loyalty card information within the Mzansi Wallet.\n• To provide technical support and improve our app's functionality.";
|
||||
String dataShare =
|
||||
"We only share your data under the following conditions:\n• With Your Consent: Businesses can access your information only with your explicit permission.\n• Legal Obligations: We may disclose information to comply with applicable laws or regulations.";
|
||||
String dataSec =
|
||||
"We implement advanced security measures to protect your personal data:\n• Data encryption during transmission.\n• Secure authentication protocols to prevent unauthorized access.\n• Regular audits to identify and address vulnerabilities.";
|
||||
List<Widget> getPrivacyPolicyText(BuildContext context, bool english) {
|
||||
String effectDate = english ? "6 December 2024" : "2024年12月6日";
|
||||
String intro = english
|
||||
? "Mzansi Innovation Hub - MIH (\"we,\" \"our,\" \"us\") values your privacy and is committed to protecting your personal data. This Privacy Policy explains how we collect, use, disclose, and safeguard your information when you use our app, Mzansi Innovation Hub - MIH, available globally."
|
||||
: "Mzansi Innovation Hub - MIH(“我们”)重视您的隐私,并致力于保护您的个人数据。本隐私政策解释了当您使用我们面向全球推出的应用程序 Mzansi Innovation Hub - MIH 时,我们如何收集、使用、披露和保护您的信息。";
|
||||
String infoCollect = english
|
||||
? "We collect the following personal information to provide and improve our services:\n• Personal Details: Name, ID, address, phone number etc.\n• Medical Information: Medical aid details (if applicable).\n• Loyalty Card Information: Loyalty card numbers for the Mzansi Wallet feature."
|
||||
: "我们收集以下个人信息以提供和改进我们的服务:\n• 个人详细信息:姓名、身份证、地址、电话号码等。\n• 医疗信息:医疗援助详情(如适用)。\n• 忠诚卡信息:Mzansi Wallet 功能的忠诚卡号码。";
|
||||
String useInfo = english
|
||||
? "Your personal information is used for the following purposes:\n• To create and manage your account.\n• To facilitate interactions between clients and businesses.\n• To enable the storage of loyalty card information within the Mzansi Wallet.\n• To provide technical support and improve our app's functionality."
|
||||
: "您的个人信息用于以下目的:\n• 创建和管理您的账户。\n• 促进客户与企业之间的互动。\n• 使忠诚卡信息能够存储在 Mzansi Wallet 中。\n• 提供技术支持并改进我们应用程序的功能。";
|
||||
String dataShare = english
|
||||
? "We only share your data under the following conditions:\n• With Your Consent: Businesses can access your information only with your explicit permission.\n• Legal Obligations: We may disclose information to comply with applicable laws or regulations."
|
||||
: "我们仅在以下情况下共享您的数据:\n• 经您同意:企业只能在您明确许可的情况下访问您的信息。\n• 法律义务:我们可能会披露信息以遵守适用的法律或法规。";
|
||||
String dataSec = english
|
||||
? "We implement advanced security measures to protect your personal data:\n• Data encryption during transmission.\n• Secure authentication protocols to prevent unauthorized access.\n• Regular audits to identify and address vulnerabilities."
|
||||
: "我们实施先进的安全措施来保护您的个人数据:\n• 传输过程中对数据进行加密。\n• 安全的身份验证协议以防止未经授权的访问。\n• 定期审计以识别和解决漏洞。";
|
||||
|
||||
String yourRights =
|
||||
"You have the following rights regarding your personal data:\n• Access and Correction: View and update your information via your account settings.\n• Data Deletion: Request the deletion of your account and associated data.\n• Withdrawal of Consent: Revoke permissions for businesses to access your data is restricted once granted.\n• To exercise these rights, contact us at mzansi.innovation.hub@gmail.com.";
|
||||
String dataRet =
|
||||
"We retain your personal data for as long as necessary to provide our services. Upon account deletion, your data will be permanently removed unless required by law to retain certain records.";
|
||||
String policyChanges =
|
||||
"We may update this Privacy Policy to reflect changes in our practices or legal requirements. We will notify you of significant updates via in app notifications and/ or email.";
|
||||
String contactUs =
|
||||
"If you have questions or concerns about this Privacy Policy, please contact us:\n• Email: mzansi.innovation.hub@gmail.com\n• Phone: +27 655 530 195\n";
|
||||
String yourRights = english
|
||||
? "You have the following rights regarding your personal data:\n• Access and Correction: View and update your information via your account settings.\n• Data Deletion: Request the deletion of your account and associated data.\n• Withdrawal of Consent: Revoke permissions for businesses to access your data is restricted once granted.\n• To exercise these rights, contact us at mzansi.innovation.hub@gmail.com."
|
||||
: "您对您的个人数据享有以下权利:\n• 访问和更正:通过您的账户设置查看和更新您的信息。\n• 数据删除:请求删除您的账户及相关数据。\n• 撤回同意:一旦授予权限,撤销企业访问您数据的权限将受到限制。\n• 要行使这些权利,请通过 mzansi.innovation.hub@gmail.com 与我们联系。";
|
||||
String dataRet = english
|
||||
? "We retain your personal data for as long as necessary to provide our services. Upon account deletion, your data will be permanently removed unless required by law to retain certain records."
|
||||
: "我们会在提供服务所需的时间内保留您的个人数据。账户删除后,您的数据将被永久删除,除非法律要求保留某些记录。";
|
||||
String policyChanges = english
|
||||
? "We may update this Privacy Policy to reflect changes in our practices or legal requirements. We will notify you of significant updates via in app notifications and/ or email."
|
||||
: "我们可能会更新本隐私政策以反映我们的做法或法律要求的变化。我们将通过应用内通知和/或电子邮件通知您重大更新。";
|
||||
String contactUs = english
|
||||
? "If you have questions or concerns about this Privacy Policy, please contact us:\n• Email: mzansi.innovation.hub@gmail.com\n• Phone: +27 655 530 195\n"
|
||||
: "如果您对本隐私政策有任何疑问或担忧,请通过以下方式与我们联系:\n• 电子邮件: mzansi.innovation.hub@gmail.com.\n• 电话: +27 655 530 195";
|
||||
return [
|
||||
SizedBox(
|
||||
width: 165,
|
||||
@@ -42,8 +51,8 @@ class PolicyAndTermsText {
|
||||
width: 1250,
|
||||
child: Row(
|
||||
children: [
|
||||
const Text(
|
||||
"Effective Date: ",
|
||||
Text(
|
||||
english ? "Effective Date: " : "生效日期: ",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
@@ -86,13 +95,13 @@ class PolicyAndTermsText {
|
||||
height: 10,
|
||||
),
|
||||
//=============== 1. Information We Collect ===============
|
||||
const SizedBox(
|
||||
SizedBox(
|
||||
width: 1250,
|
||||
child: Row(
|
||||
// crossAxisAlignment: WrapCrossAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"1. Information We Collect",
|
||||
english ? "1. Information We Collect" : "1. 我们收集的信息",
|
||||
textAlign: TextAlign.start,
|
||||
softWrap: true,
|
||||
style: TextStyle(
|
||||
@@ -124,13 +133,13 @@ class PolicyAndTermsText {
|
||||
height: 10,
|
||||
),
|
||||
//=============== 2. How We Use Your Information ===============
|
||||
const SizedBox(
|
||||
SizedBox(
|
||||
width: 1250,
|
||||
child: Row(
|
||||
// crossAxisAlignment: WrapCrossAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"2. How We Use Your Information",
|
||||
english ? "2. How We Use Your Information" : "2. 我们如何使用您的信息",
|
||||
textAlign: TextAlign.start,
|
||||
softWrap: true,
|
||||
style: TextStyle(
|
||||
@@ -162,13 +171,13 @@ class PolicyAndTermsText {
|
||||
height: 10,
|
||||
),
|
||||
//=============== 3. Data Sharing ===============
|
||||
const SizedBox(
|
||||
SizedBox(
|
||||
width: 1250,
|
||||
child: Row(
|
||||
// crossAxisAlignment: WrapCrossAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"3. Data Sharing",
|
||||
english ? "3. Data Sharing" : "3. 数据共享",
|
||||
textAlign: TextAlign.start,
|
||||
softWrap: true,
|
||||
style: TextStyle(
|
||||
@@ -200,13 +209,13 @@ class PolicyAndTermsText {
|
||||
height: 10,
|
||||
),
|
||||
//=============== 4. Data Security ===============
|
||||
const SizedBox(
|
||||
SizedBox(
|
||||
width: 1250,
|
||||
child: Row(
|
||||
// crossAxisAlignment: WrapCrossAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"4. Data Security",
|
||||
english ? "4. Data Security" : "4. 数据安全",
|
||||
textAlign: TextAlign.start,
|
||||
softWrap: true,
|
||||
style: TextStyle(
|
||||
@@ -238,13 +247,13 @@ class PolicyAndTermsText {
|
||||
height: 10,
|
||||
),
|
||||
//=============== 5. Your Rights ===============
|
||||
const SizedBox(
|
||||
SizedBox(
|
||||
width: 1250,
|
||||
child: Row(
|
||||
// crossAxisAlignment: WrapCrossAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"5. Your Rights",
|
||||
english ? "5. Your Rights" : "5. 您的权利",
|
||||
textAlign: TextAlign.start,
|
||||
softWrap: true,
|
||||
style: TextStyle(
|
||||
@@ -276,13 +285,13 @@ class PolicyAndTermsText {
|
||||
height: 10,
|
||||
),
|
||||
//=============== 6. Data Retention ===============
|
||||
const SizedBox(
|
||||
SizedBox(
|
||||
width: 1250,
|
||||
child: Row(
|
||||
// crossAxisAlignment: WrapCrossAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"6. Data Retention",
|
||||
english ? "6. Data Retention" : "6. 数据保留",
|
||||
textAlign: TextAlign.start,
|
||||
softWrap: true,
|
||||
style: TextStyle(
|
||||
@@ -314,13 +323,13 @@ class PolicyAndTermsText {
|
||||
height: 10,
|
||||
),
|
||||
//=============== 7. Changes to This Privacy Policy ===============
|
||||
const SizedBox(
|
||||
SizedBox(
|
||||
width: 1250,
|
||||
child: Row(
|
||||
// crossAxisAlignment: WrapCrossAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"7. Changes to This Privacy Policy",
|
||||
english ? "7. Changes to This Privacy Policy" : "7. 本隐私政策的变更",
|
||||
textAlign: TextAlign.start,
|
||||
softWrap: true,
|
||||
style: TextStyle(
|
||||
@@ -352,13 +361,13 @@ class PolicyAndTermsText {
|
||||
height: 10,
|
||||
),
|
||||
//=============== 8. Contact Us ===============
|
||||
const SizedBox(
|
||||
SizedBox(
|
||||
width: 1250,
|
||||
child: Row(
|
||||
// crossAxisAlignment: WrapCrossAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"8. Contact Us",
|
||||
english ? "8. Contact Us" : "8. 联系我们",
|
||||
textAlign: TextAlign.start,
|
||||
softWrap: true,
|
||||
style: TextStyle(
|
||||
@@ -392,37 +401,51 @@ class PolicyAndTermsText {
|
||||
];
|
||||
}
|
||||
|
||||
List<Widget> getTermsOfServiceText(BuildContext context) {
|
||||
String effectDate = "6 December 2024";
|
||||
String intro =
|
||||
"Welcome to Mzansi Innovation Hub (MIH)! These Terms of Service (\"Terms\") govern your access to and use of our application and services (\"Services\"). By accessing or using Mzansi Innovation Hub (MIH), you agree to these Terms.";
|
||||
String acceptTerms =
|
||||
"By creating an account or using the app, you agree to be bound by these Terms. If you do not agree, please do not use the Services.";
|
||||
String eligib =
|
||||
"You must be at least 18 years old or the age of majority in your jurisdiction to use this app. By using the app, you represent and warrant that you meet these eligibility requirements.";
|
||||
String yourResponse =
|
||||
"• Account Security: You are responsible for maintaining the confidentiality of your login credentials.\n• Accurate Information: Ensure that all data you provide is accurate and up to date.\n• Prohibited Uses:\n\t\t• Do not use the app for unlawful purposes.\n\t\t• Do not engage in activities that could harm the app or its users, such as hacking, data scraping, or introducing malware.";
|
||||
String ourServ =
|
||||
"• We provide tools to help businesses and clients interact, including a patient manager and the Mzansi Wallet etc.\n• We do not guarantee uninterrupted or error-free services, though we strive to maintain high reliability.";
|
||||
List<Widget> getTermsOfServiceText(BuildContext context, bool english) {
|
||||
String effectDate = english ? "6 December 2024" : "2024年12月6日";
|
||||
String intro = english
|
||||
? "Welcome to Mzansi Innovation Hub (MIH)! These Terms of Service (\"Terms\") govern your access to and use of our application and services (\"Services\"). By accessing or using Mzansi Innovation Hub (MIH), you agree to these Terms."
|
||||
: "欢迎使用 Mzansi Innovation Hub (MIH)!本服务条款(“条款”)管理您对我们应用程序和服务(“服务”)的访问和使用。通过访问或使用 Mzansi Innovation Hub (MIH),您同意这些条款。";
|
||||
String acceptTerms = english
|
||||
? "By creating an account or using the app, you agree to be bound by these Terms. If you do not agree, please do not use the Services."
|
||||
: "通过创建账户或使用该应用程序,您同意受这些条款的约束。如果您不同意,请不要使用该服务。";
|
||||
String eligib = english
|
||||
? "You must be at least 18 years old or the age of majority in your jurisdiction to use this app. By using the app, you represent and warrant that you meet these eligibility requirements."
|
||||
: "您必须年满18岁或达到您所在司法管辖区的法定年龄才能使用此应用程序。通过使用该应用程序,您声明并保证您符合这些资格要求。";
|
||||
String yourResponse = english
|
||||
? "• Account Security: You are responsible for maintaining the confidentiality of your login credentials.\n• Accurate Information: Ensure that all data you provide is accurate and up to date.\n• Prohibited Uses:\n\t\t• Do not use the app for unlawful purposes.\n\t\t• Do not engage in activities that could harm the app or its users, such as hacking, data scraping, or introducing malware."
|
||||
: "• 账户安全:您有责任维护您的登录凭据的机密性。\n• 准确信息:确保您提供的所有数据都是准确和最新的。\n• 禁止使用:\n\t\t• 不得将该应用程序用于非法目的。\n\t\t• 不得从事可能损害该应用程序或其用户的活动,例如黑客攻击、数据抓取或引入恶意软件。";
|
||||
String ourServ = english
|
||||
? "• We provide tools to help businesses and clients interact, including a patient manager and the Mzansi Wallet etc.\n• We do not guarantee uninterrupted or error-free services, though we strive to maintain high reliability."
|
||||
: "• 我们提供工具来帮助企业和客户互动,包括患者管理器和 Mzansi Wallet 等。\n• 我们不保证服务不中断或无错误,但我们努力保持高可靠性。";
|
||||
|
||||
String dataCol =
|
||||
"Your use of the app is subject to our Privacy Policy, which explains how we collect, use, and protect your data. By using the app, you consent to these practices.";
|
||||
String userContent =
|
||||
"• Ownership: Any content you submit to the app (e.g., loyalty card data, client profiles) remains your property.\n• License: By using the app, you grant us a non-exclusive license to use your content solely to operate the app and provide services.";
|
||||
String intelProp =
|
||||
"• All rights to the app, including designs, code, and trademarks, belong to Mzansi Innovation Hub.\n• Users may not copy, distribute, or reverse-engineer any part of the app.";
|
||||
String termUse =
|
||||
"We reserve the right to suspend or terminate your account for violations of these Terms or if required by law.";
|
||||
String disclaimerWarens =
|
||||
"The app and services are provided \"as is\" without warranties of any kind, whether express or implied. We do not guarantee that the app will meet your expectations or requirements.";
|
||||
String limitLiability =
|
||||
"To the maximum extent permitted by law, we are not liable for:\n• Indirect, incidental, or consequential damages arising from the use or inability to use the app.\n• Loss of data, revenue, or profits.";
|
||||
String modifyTerms =
|
||||
"We may update these Terms periodically. Continued use of the app after changes are posted constitutes your acceptance of the new Terms.";
|
||||
String governLaw =
|
||||
"These Terms are governed by the laws of South Africa. Any disputes will be resolved in courts located in South Africa.";
|
||||
String contactUs =
|
||||
"If you have questions about these Terms, please contact us:\n• Email: mzansi.innovation.hub@gmail.com\n• Phone: +27 655 530 195\n";
|
||||
String dataCol = english
|
||||
? "Your use of the app is subject to our Privacy Policy, which explains how we collect, use, and protect your data. By using the app, you consent to these practices."
|
||||
: "您对该应用程序的使用受我们的隐私政策约束,该政策解释了我们如何收集、使用和保护您的数据。通过使用该应用程序,您同意这些做法。";
|
||||
String userContent = english
|
||||
? "• Ownership: Any content you submit to the app (e.g., loyalty card data, client profiles) remains your property.\n• License: By using the app, you grant us a non-exclusive license to use your content solely to operate the app and provide services."
|
||||
: "• 所有权:您提交到该应用程序的任何内容(例如,忠诚卡数据、客户档案)仍然是您的财产。\n• 许可:通过使用该应用程序,您授予我们非独占许可,仅用于运营该应用程序和提供服务。";
|
||||
String intelProp = english
|
||||
? "• All rights to the app, including designs, code, and trademarks, belong to Mzansi Innovation Hub.\n• Users may not copy, distribute, or reverse-engineer any part of the app."
|
||||
: "• 该应用程序的所有权利,包括设计、代码和商标,均属于 Mzansi Innovation Hub。\n• 用户不得复制、分发或反向工程该应用程序的任何部分。";
|
||||
String termUse = english
|
||||
? "We reserve the right to suspend or terminate your account for violations of these Terms or if required by law."
|
||||
: "我们保留因违反这些条款或法律要求而暂停或终止您账户的权利。";
|
||||
String disclaimerWarens = english
|
||||
? "The app and services are provided \"as is\" without warranties of any kind, whether express or implied. We do not guarantee that the app will meet your expectations or requirements."
|
||||
: "该应用程序和服务按“原样”提供,不附带任何形式的明示或暗示保证。我们不保证该应用程序将满足您的期望或要求。";
|
||||
String limitLiability = english
|
||||
? "To the maximum extent permitted by law, we are not liable for:\n• Indirect, incidental, or consequential damages arising from the use or inability to use the app.\n• Loss of data, revenue, or profits."
|
||||
: "在法律允许的最大范围内,我们不对以下事项承担责任:\n• 因使用或无法使用该应用程序而产生的间接、附带或后果性损害。\n• 数据、收入或利润的损失。";
|
||||
String modifyTerms = english
|
||||
? "We may update these Terms periodically. Continued use of the app after changes are posted constitutes your acceptance of the new Terms."
|
||||
: "我们可能会定期更新这些条款。在更改发布后继续使用该应用程序即表示您接受新的条款。";
|
||||
String governLaw = english
|
||||
? "These Terms are governed by the laws of South Africa. Any disputes will be resolved in courts located in South Africa."
|
||||
: "这些条款受南非法律管辖。任何争议将由位于南非的法院解决。";
|
||||
String contactUs = english
|
||||
? "If you have questions about these Terms, please contact us:\n• Email: mzansi.innovation.hub@gmail.com\n• Phone: +27 655 530 195\n"
|
||||
: "如果您对这些条款有任何疑问,请通过以下方式与我们联系:\n• 电子邮件: mzansi.innovation.hub@gmail.com.\n• 电话: +27 655 530 195";
|
||||
return [
|
||||
SizedBox(
|
||||
width: 165,
|
||||
@@ -442,8 +465,8 @@ class PolicyAndTermsText {
|
||||
width: 1250,
|
||||
child: Row(
|
||||
children: [
|
||||
const Text(
|
||||
"Effective Date: ",
|
||||
Text(
|
||||
english ? "Effective Date: " : "生效日期: ",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
@@ -486,13 +509,13 @@ class PolicyAndTermsText {
|
||||
height: 10,
|
||||
),
|
||||
//=============== 1. Acceptance of Terms ===============
|
||||
const SizedBox(
|
||||
SizedBox(
|
||||
width: 1250,
|
||||
child: Row(
|
||||
// crossAxisAlignment: WrapCrossAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"1. Acceptance of Terms",
|
||||
english ? "1. Acceptance of Terms" : "1. 接受条款",
|
||||
textAlign: TextAlign.start,
|
||||
softWrap: true,
|
||||
style: TextStyle(
|
||||
@@ -524,13 +547,13 @@ class PolicyAndTermsText {
|
||||
height: 10,
|
||||
),
|
||||
//=============== 2. Eligibility ===============
|
||||
const SizedBox(
|
||||
SizedBox(
|
||||
width: 1250,
|
||||
child: Row(
|
||||
// crossAxisAlignment: WrapCrossAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"2. Eligibility",
|
||||
english ? "2. Eligibility" : "2. 资格",
|
||||
textAlign: TextAlign.start,
|
||||
softWrap: true,
|
||||
style: TextStyle(
|
||||
@@ -562,13 +585,13 @@ class PolicyAndTermsText {
|
||||
height: 10,
|
||||
),
|
||||
//=============== 3. Your Responsibilities ===============
|
||||
const SizedBox(
|
||||
SizedBox(
|
||||
width: 1250,
|
||||
child: Row(
|
||||
// crossAxisAlignment: WrapCrossAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"3. Your Responsibilities",
|
||||
english ? "3. Your Responsibilities" : "3. 您的责任",
|
||||
textAlign: TextAlign.start,
|
||||
softWrap: true,
|
||||
style: TextStyle(
|
||||
@@ -600,13 +623,13 @@ class PolicyAndTermsText {
|
||||
height: 10,
|
||||
),
|
||||
//=============== 4. Data Security ===============
|
||||
const SizedBox(
|
||||
SizedBox(
|
||||
width: 1250,
|
||||
child: Row(
|
||||
// crossAxisAlignment: WrapCrossAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"4. Our Services",
|
||||
english ? "4. Our Services" : "4. 我们的服务",
|
||||
textAlign: TextAlign.start,
|
||||
softWrap: true,
|
||||
style: TextStyle(
|
||||
@@ -638,13 +661,13 @@ class PolicyAndTermsText {
|
||||
height: 10,
|
||||
),
|
||||
//=============== 5. Data Collection and Privacy ===============
|
||||
const SizedBox(
|
||||
SizedBox(
|
||||
width: 1250,
|
||||
child: Row(
|
||||
// crossAxisAlignment: WrapCrossAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"5. Data Collection and Privacy",
|
||||
english ? "5. Data Collection and Privacy" : "5. 数据收集和隐私",
|
||||
textAlign: TextAlign.start,
|
||||
softWrap: true,
|
||||
style: TextStyle(
|
||||
@@ -676,13 +699,13 @@ class PolicyAndTermsText {
|
||||
height: 10,
|
||||
),
|
||||
//=============== 6. User-Generated Content ===============
|
||||
const SizedBox(
|
||||
SizedBox(
|
||||
width: 1250,
|
||||
child: Row(
|
||||
// crossAxisAlignment: WrapCrossAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"6. User-Generated Content",
|
||||
english ? "6. User-Generated Content" : "6. 用户生成的内容",
|
||||
textAlign: TextAlign.start,
|
||||
softWrap: true,
|
||||
style: TextStyle(
|
||||
@@ -714,13 +737,13 @@ class PolicyAndTermsText {
|
||||
height: 10,
|
||||
),
|
||||
//=============== 7. Intellectual Property ===============
|
||||
const SizedBox(
|
||||
SizedBox(
|
||||
width: 1250,
|
||||
child: Row(
|
||||
// crossAxisAlignment: WrapCrossAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"7. Intellectual Property",
|
||||
english ? "7. Intellectual Property" : "7. 知识产权",
|
||||
textAlign: TextAlign.start,
|
||||
softWrap: true,
|
||||
style: TextStyle(
|
||||
@@ -752,13 +775,13 @@ class PolicyAndTermsText {
|
||||
height: 10,
|
||||
),
|
||||
//=============== 8. Termination of Use ===============
|
||||
const SizedBox(
|
||||
SizedBox(
|
||||
width: 1250,
|
||||
child: Row(
|
||||
// crossAxisAlignment: WrapCrossAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"8. Termination of Use",
|
||||
english ? "8. Termination of Use" : "8. 使用终止",
|
||||
textAlign: TextAlign.start,
|
||||
softWrap: true,
|
||||
style: TextStyle(
|
||||
@@ -790,13 +813,13 @@ class PolicyAndTermsText {
|
||||
height: 10,
|
||||
),
|
||||
//=============== 9. Disclaimer of Warranties ===============
|
||||
const SizedBox(
|
||||
SizedBox(
|
||||
width: 1250,
|
||||
child: Row(
|
||||
// crossAxisAlignment: WrapCrossAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"9. Disclaimer of Warranties",
|
||||
english ? "9. Disclaimer of Warranties" : "9. 免责声明",
|
||||
textAlign: TextAlign.start,
|
||||
softWrap: true,
|
||||
style: TextStyle(
|
||||
@@ -828,13 +851,13 @@ class PolicyAndTermsText {
|
||||
height: 10,
|
||||
),
|
||||
//=============== 10. Limitation of Liability ===============
|
||||
const SizedBox(
|
||||
SizedBox(
|
||||
width: 1250,
|
||||
child: Row(
|
||||
// crossAxisAlignment: WrapCrossAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"10. Limitation of Liability",
|
||||
english ? "10. Limitation of Liability" : "10. 责任限制",
|
||||
textAlign: TextAlign.start,
|
||||
softWrap: true,
|
||||
style: TextStyle(
|
||||
@@ -866,13 +889,13 @@ class PolicyAndTermsText {
|
||||
height: 10,
|
||||
),
|
||||
//=============== 11. Modifications to Terms ===============
|
||||
const SizedBox(
|
||||
SizedBox(
|
||||
width: 1250,
|
||||
child: Row(
|
||||
// crossAxisAlignment: WrapCrossAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"11. Modifications to Terms",
|
||||
english ? "11. Modifications to Terms" : "11. 条款修改",
|
||||
textAlign: TextAlign.start,
|
||||
softWrap: true,
|
||||
style: TextStyle(
|
||||
@@ -904,13 +927,13 @@ class PolicyAndTermsText {
|
||||
height: 10,
|
||||
),
|
||||
//=============== 12. Governing Law ===============
|
||||
const SizedBox(
|
||||
SizedBox(
|
||||
width: 1250,
|
||||
child: Row(
|
||||
// crossAxisAlignment: WrapCrossAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"12. Governing Law",
|
||||
english ? "12. Governing Law" : "12. 适用法律",
|
||||
textAlign: TextAlign.start,
|
||||
softWrap: true,
|
||||
style: TextStyle(
|
||||
@@ -942,13 +965,13 @@ class PolicyAndTermsText {
|
||||
height: 10,
|
||||
),
|
||||
//=============== 13. Contact Information ===============
|
||||
const SizedBox(
|
||||
SizedBox(
|
||||
width: 1250,
|
||||
child: Row(
|
||||
// crossAxisAlignment: WrapCrossAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"13. Contact Information",
|
||||
english ? "13. Contact Information" : "13. 联系信息",
|
||||
textAlign: TextAlign.start,
|
||||
softWrap: true,
|
||||
style: TextStyle(
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_objects/arguments.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tile.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_icons.dart';
|
||||
@@ -8,11 +7,9 @@ import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
|
||||
class AboutMihTile extends StatefulWidget {
|
||||
final double packageSize;
|
||||
final bool personalSelected;
|
||||
const AboutMihTile({
|
||||
super.key,
|
||||
required this.packageSize,
|
||||
required this.personalSelected,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -26,10 +23,6 @@ class _AboutMihTileState extends State<AboutMihTile> {
|
||||
onTap: () {
|
||||
context.goNamed(
|
||||
"aboutMih",
|
||||
extra: AboutArguments(
|
||||
widget.personalSelected,
|
||||
0,
|
||||
),
|
||||
);
|
||||
// Navigator.of(context).pushNamed(
|
||||
// '/about',
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_services/mih_business_details_services.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_services/mih_install_services.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_single_child_scroll.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_tile.dart';
|
||||
@@ -11,7 +12,9 @@ import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_floating_menu.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_icons.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_services/mih_user_services.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
import 'package:redacted/redacted.dart';
|
||||
import 'package:share_plus/share_plus.dart';
|
||||
|
||||
class MihInfo extends StatefulWidget {
|
||||
@@ -22,6 +25,8 @@ class MihInfo extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _MihInfoState extends State<MihInfo> {
|
||||
late Future<int> _futureUserCount;
|
||||
late Future<int> _futureBusinessCount;
|
||||
final Uri _tiktokUrl =
|
||||
Uri.parse('https://www.tiktok.com/@mzansi.innovation.hub');
|
||||
final Uri _whatsappUrl =
|
||||
@@ -87,7 +92,7 @@ class _MihInfoState extends State<MihInfo> {
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(
|
||||
//fontWeight: FontWeight.bold,
|
||||
fontSize: 15,
|
||||
fontSize: 17,
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -144,7 +149,7 @@ class _MihInfoState extends State<MihInfo> {
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(
|
||||
//fontWeight: FontWeight.bold,
|
||||
fontSize: 15,
|
||||
fontSize: 17,
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -178,7 +183,7 @@ class _MihInfoState extends State<MihInfo> {
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(
|
||||
//fontWeight: FontWeight.bold,
|
||||
fontSize: 15,
|
||||
fontSize: 17,
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -501,11 +506,128 @@ class _MihInfoState extends State<MihInfo> {
|
||||
|
||||
void shareMIHLink(BuildContext context, String message, String link) {
|
||||
String shareText = "$message: $link";
|
||||
Share.share(
|
||||
shareText,
|
||||
SharePlus.instance.share(
|
||||
ShareParams(text: shareText),
|
||||
);
|
||||
}
|
||||
|
||||
Widget displayBusinessCount() {
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
FutureBuilder<int>(
|
||||
future: _futureBusinessCount,
|
||||
builder: (context, snapshot) {
|
||||
bool isLoading = true;
|
||||
String userCount = "⚠️";
|
||||
if (snapshot.connectionState == ConnectionState.waiting) {
|
||||
isLoading = true;
|
||||
} else if (snapshot.connectionState == ConnectionState.done &&
|
||||
snapshot.hasError) {
|
||||
isLoading = false;
|
||||
} else if (snapshot.connectionState == ConnectionState.done &&
|
||||
snapshot.hasData) {
|
||||
isLoading = false;
|
||||
userCount = snapshot.data.toString();
|
||||
} else {
|
||||
isLoading = true;
|
||||
}
|
||||
return SizedBox(
|
||||
child: Text(
|
||||
userCount,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 23,
|
||||
),
|
||||
),
|
||||
).redacted(
|
||||
context: context,
|
||||
redact: isLoading,
|
||||
configuration: RedactedConfiguration(
|
||||
defaultBorderRadius: BorderRadius.circular(5),
|
||||
redactedColor: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark",
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Text(
|
||||
"Businesses",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: 20,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget displayUserCount() {
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
FutureBuilder<int>(
|
||||
future: _futureUserCount,
|
||||
builder: (context, snapshot) {
|
||||
bool isLoading = true;
|
||||
String userCount = "⚠️";
|
||||
if (snapshot.connectionState == ConnectionState.waiting) {
|
||||
isLoading = true;
|
||||
} else if (snapshot.connectionState == ConnectionState.done &&
|
||||
snapshot.hasError) {
|
||||
isLoading = false;
|
||||
} else if (snapshot.connectionState == ConnectionState.done &&
|
||||
snapshot.hasData) {
|
||||
isLoading = false;
|
||||
userCount = snapshot.data.toString();
|
||||
} else {
|
||||
isLoading = true;
|
||||
}
|
||||
return SizedBox(
|
||||
child: Text(
|
||||
userCount,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 23,
|
||||
),
|
||||
),
|
||||
).redacted(
|
||||
context: context,
|
||||
redact: isLoading,
|
||||
configuration: RedactedConfiguration(
|
||||
defaultBorderRadius: BorderRadius.circular(5),
|
||||
redactedColor: MihColors.getSecondaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark",
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Text(
|
||||
"People",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: 20,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_futureUserCount = MihUserServices().fetchUserCount();
|
||||
_futureBusinessCount = MihBusinessDetailsServices().fetchBusinessCount();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihPackageToolBody(
|
||||
@@ -536,6 +658,7 @@ class _MihInfoState extends State<MihInfo> {
|
||||
),
|
||||
const Text(
|
||||
"Mzansi Innovation Hub",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 30,
|
||||
@@ -543,19 +666,71 @@ class _MihInfoState extends State<MihInfo> {
|
||||
),
|
||||
Text(
|
||||
"MIH App Version: ${MzansiInnovationHub.of(context)!.theme.getLatestVersion()}",
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: 15,
|
||||
),
|
||||
),
|
||||
const Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 10.0),
|
||||
child: Divider(),
|
||||
// ===================== Divider
|
||||
// Padding(
|
||||
// padding: EdgeInsets.symmetric(
|
||||
// vertical: 10.0,
|
||||
// horizontal: 25,
|
||||
// ),
|
||||
// child: Divider(
|
||||
// thickness: 1,
|
||||
// color: MihColors.getGreyColor(
|
||||
// MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
// ),
|
||||
// ),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
// Text(
|
||||
// "The MIH Community",
|
||||
// textAlign: TextAlign.center,
|
||||
// style: TextStyle(
|
||||
// fontWeight: FontWeight.bold,
|
||||
// fontSize: 22,
|
||||
// ),
|
||||
// ),
|
||||
Wrap(
|
||||
alignment: WrapAlignment.spaceAround,
|
||||
crossAxisAlignment: WrapCrossAlignment.center,
|
||||
spacing: 25,
|
||||
runSpacing: 10,
|
||||
children: [
|
||||
displayUserCount(),
|
||||
displayBusinessCount(),
|
||||
],
|
||||
),
|
||||
Text(
|
||||
"The MIH Community",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 22,
|
||||
),
|
||||
),
|
||||
// ===================== Divider
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
vertical: 10.0,
|
||||
horizontal: 25,
|
||||
),
|
||||
child: Divider(
|
||||
thickness: 1,
|
||||
color: MihColors.getGreyColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
),
|
||||
),
|
||||
// const SizedBox(
|
||||
// height: 10,
|
||||
// ),
|
||||
Wrap(
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 25.0),
|
||||
child: Wrap(
|
||||
alignment: WrapAlignment.start,
|
||||
crossAxisAlignment: WrapCrossAlignment.start,
|
||||
spacing: 10,
|
||||
@@ -565,8 +740,9 @@ class _MihInfoState extends State<MihInfo> {
|
||||
ourMission(),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
height: 25,
|
||||
),
|
||||
Wrap(
|
||||
alignment: WrapAlignment.center,
|
||||
@@ -658,9 +834,17 @@ class _MihInfoState extends State<MihInfo> {
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
const Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 10.0),
|
||||
child: Divider(),
|
||||
// ===================== Divider
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
vertical: 10.0,
|
||||
horizontal: 25,
|
||||
),
|
||||
child: Divider(
|
||||
thickness: 1,
|
||||
color: MihColors.getGreyColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
),
|
||||
),
|
||||
Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
@@ -673,9 +857,17 @@ class _MihInfoState extends State<MihInfo> {
|
||||
founderBio(),
|
||||
],
|
||||
),
|
||||
const Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 10.0),
|
||||
child: Divider(),
|
||||
// ===================== Divider
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
vertical: 10.0,
|
||||
horizontal: 25,
|
||||
),
|
||||
child: Divider(
|
||||
thickness: 1,
|
||||
color: MihColors.getGreyColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
),
|
||||
),
|
||||
mihSocials(),
|
||||
],
|
||||
|
||||
@@ -1,11 +1,20 @@
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_single_child_scroll.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tool_body.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/about_mih/mih_policy_tos_ext/policy_and_terms_text.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class MihPrivacyPolicy extends StatelessWidget {
|
||||
class MihPrivacyPolicy extends StatefulWidget {
|
||||
const MihPrivacyPolicy({super.key});
|
||||
|
||||
@override
|
||||
State<MihPrivacyPolicy> createState() => _MihPrivacyPolicyState();
|
||||
}
|
||||
|
||||
class _MihPrivacyPolicyState extends State<MihPrivacyPolicy> {
|
||||
bool englishOn = true;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihPackageToolBody(
|
||||
@@ -16,9 +25,39 @@ class MihPrivacyPolicy extends StatelessWidget {
|
||||
}
|
||||
|
||||
Widget getBody(BuildContext context) {
|
||||
List<Widget> children = [
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
MihButton(
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
englishOn = !englishOn;
|
||||
});
|
||||
},
|
||||
buttonColor: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
elevation: 10,
|
||||
child: Text(
|
||||
englishOn ? "Simplified Chinese" : "English",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
];
|
||||
children
|
||||
.addAll(PolicyAndTermsText().getPrivacyPolicyText(context, englishOn));
|
||||
return MihSingleChildScroll(
|
||||
child: Column(
|
||||
children: PolicyAndTermsText().getPrivacyPolicyText(context),
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: children,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,11 +1,20 @@
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_single_child_scroll.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tool_body.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/about_mih/mih_policy_tos_ext/policy_and_terms_text.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class MIHTermsOfService extends StatelessWidget {
|
||||
class MIHTermsOfService extends StatefulWidget {
|
||||
const MIHTermsOfService({super.key});
|
||||
|
||||
@override
|
||||
State<MIHTermsOfService> createState() => _MIHTermsOfServiceState();
|
||||
}
|
||||
|
||||
class _MIHTermsOfServiceState extends State<MIHTermsOfService> {
|
||||
bool englishOn = true;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihPackageToolBody(
|
||||
@@ -16,9 +25,38 @@ class MIHTermsOfService extends StatelessWidget {
|
||||
}
|
||||
|
||||
Widget getBody(BuildContext context) {
|
||||
List<Widget> children = [
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
MihButton(
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
englishOn = !englishOn;
|
||||
});
|
||||
},
|
||||
buttonColor: MihColors.getGreenColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
elevation: 10,
|
||||
child: Text(
|
||||
englishOn ? "Simplified Chinese" : "English",
|
||||
style: TextStyle(
|
||||
color: MihColors.getPrimaryColor(
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
];
|
||||
children
|
||||
.addAll(PolicyAndTermsText().getTermsOfServiceText(context, englishOn));
|
||||
return MihSingleChildScroll(
|
||||
child: Column(
|
||||
children: PolicyAndTermsText().getTermsOfServiceText(context),
|
||||
children: children,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,10 @@ import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:ken_logger/ken_logger.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_objects/patient_access.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_alert.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_providers/mih_access_controlls_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_providers/mzansi_profile_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_services/mih_access_controls_services.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart';
|
||||
@@ -10,18 +13,15 @@ import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_error_message.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_warning_message.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_env.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_objects/app_user.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_objects/patient_access.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class BuildBusinessAccessList extends StatefulWidget {
|
||||
final List<PatientAccess> patientAccessList;
|
||||
final AppUser signedInUser;
|
||||
final String filterText;
|
||||
final void Function()? onSuccessUpate;
|
||||
|
||||
const BuildBusinessAccessList({
|
||||
super.key,
|
||||
required this.patientAccessList,
|
||||
required this.signedInUser,
|
||||
required this.filterText,
|
||||
required this.onSuccessUpate,
|
||||
});
|
||||
|
||||
@@ -60,18 +60,20 @@ class _BuildPatientsListState extends State<BuildBusinessAccessList> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget displayQueue(int index) {
|
||||
String line1 =
|
||||
"Business Name: ${widget.patientAccessList[index].requested_by}";
|
||||
Widget displayQueue(
|
||||
MzansiProfileProvider mzansiProfileProvider,
|
||||
MihAccessControllsProvider accessProvider,
|
||||
int index,
|
||||
List<PatientAccess> filteredList) {
|
||||
String line1 = "Business Name: ${filteredList[index].requested_by}";
|
||||
String line2 = "";
|
||||
|
||||
line2 +=
|
||||
"Request Date: ${widget.patientAccessList[index].requested_on.substring(0, 16).replaceAll("T", " ")}\n";
|
||||
line2 +=
|
||||
"Profile Type: ${widget.patientAccessList[index].type.toUpperCase()}\n";
|
||||
"Request Date: ${filteredList[index].requested_on.substring(0, 16).replaceAll("T", " ")}\n";
|
||||
line2 += "Profile Type: ${filteredList[index].type.toUpperCase()}\n";
|
||||
//subtitle += "Business Type: ${widget.patientAccessList[index].type}\n";
|
||||
String line3 = "Status: ";
|
||||
String access = widget.patientAccessList[index].status.toUpperCase();
|
||||
String access = filteredList[index].status.toUpperCase();
|
||||
|
||||
TextSpan accessWithColour;
|
||||
if (access == "APPROVED") {
|
||||
@@ -118,7 +120,7 @@ class _BuildPatientsListState extends State<BuildBusinessAccessList> {
|
||||
// ),
|
||||
// ),
|
||||
onTap: () {
|
||||
viewApprovalPopUp(index);
|
||||
viewApprovalPopUp(mzansiProfileProvider, accessProvider, index);
|
||||
},
|
||||
// trailing: Icon(
|
||||
// Icons.arrow_forward,
|
||||
@@ -153,23 +155,24 @@ class _BuildPatientsListState extends State<BuildBusinessAccessList> {
|
||||
}
|
||||
}
|
||||
|
||||
void viewApprovalPopUp(int index) {
|
||||
void viewApprovalPopUp(MzansiProfileProvider mzansiProfileProvider,
|
||||
MihAccessControllsProvider accessProvider, int index) {
|
||||
String subtitle =
|
||||
"Business Name: ${widget.patientAccessList[index].requested_by}\n";
|
||||
"Business Name: ${accessProvider.accessList![index].requested_by}\n";
|
||||
subtitle +=
|
||||
"Requested Date: ${widget.patientAccessList[index].requested_on.substring(0, 16).replaceAll("T", " ")}\n";
|
||||
"Requested Date: ${accessProvider.accessList![index].requested_on.substring(0, 16).replaceAll("T", " ")}\n";
|
||||
|
||||
subtitle +=
|
||||
"Profile Type: ${widget.patientAccessList[index].type.toUpperCase()}\n";
|
||||
"Profile Type: ${accessProvider.accessList![index].type.toUpperCase()}\n";
|
||||
subtitle +=
|
||||
"Status: ${widget.patientAccessList[index].status.toUpperCase()}";
|
||||
if (widget.patientAccessList[index].status == 'pending') {
|
||||
"Status: ${accessProvider.accessList![index].status.toUpperCase()}";
|
||||
if (accessProvider.accessList![index].status == 'pending') {
|
||||
// "\nYou are about to approve an access request to your patient profile.\nPlease be aware that once approved, ${widget.patientAccessList[index].requested_by} will have access to your profile forever and will be able to contribute to it.\nIf you are unsure about an upcoming appointment with ${widget.patientAccessList[index].requested_by}, please contact *Add Number here* for clarification before approving this request.";
|
||||
} else {
|
||||
subtitle +=
|
||||
"\nActioned By: ${widget.patientAccessList[index].approved_by}\n";
|
||||
"\nActioned By: ${accessProvider.accessList![index].approved_by}\n";
|
||||
subtitle +=
|
||||
"Actioned On: ${widget.patientAccessList[index].approved_on.substring(0, 16).replaceAll("T", " ")}";
|
||||
"Actioned On: ${accessProvider.accessList![index].approved_on.substring(0, 16).replaceAll("T", " ")}";
|
||||
// subtitle +=
|
||||
// "You have approved this access request to your patient profile.\nPlease be aware that once approved, ${widget.patientAccessList[index].requested_by} will have access to your profile forever and will be able to contribute to it.";
|
||||
}
|
||||
@@ -199,7 +202,7 @@ class _BuildPatientsListState extends State<BuildBusinessAccessList> {
|
||||
),
|
||||
const SizedBox(height: 20.0),
|
||||
Visibility(
|
||||
visible: widget.patientAccessList[index].status == 'pending',
|
||||
visible: accessProvider.accessList![index].status == 'pending',
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
@@ -271,7 +274,7 @@ class _BuildPatientsListState extends State<BuildBusinessAccessList> {
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible: widget.patientAccessList[index].status == 'approved',
|
||||
visible: accessProvider.accessList![index].status == 'approved',
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
@@ -338,7 +341,7 @@ class _BuildPatientsListState extends State<BuildBusinessAccessList> {
|
||||
height: 20,
|
||||
),
|
||||
Visibility(
|
||||
visible: widget.patientAccessList[index].status == 'pending',
|
||||
visible: accessProvider.accessList![index].status == 'pending',
|
||||
child: Wrap(
|
||||
runSpacing: 10,
|
||||
spacing: 10,
|
||||
@@ -348,15 +351,20 @@ class _BuildPatientsListState extends State<BuildBusinessAccessList> {
|
||||
print("request declined");
|
||||
int statusCode = await MihAccessControlsServices()
|
||||
.updatePatientAccessAPICall(
|
||||
widget.patientAccessList[index].business_id,
|
||||
widget.patientAccessList[index].requested_by,
|
||||
widget.patientAccessList[index].app_id,
|
||||
accessProvider.accessList![index].business_id,
|
||||
accessProvider.accessList![index].requested_by,
|
||||
accessProvider.accessList![index].app_id,
|
||||
"declined",
|
||||
"${widget.signedInUser.fname} ${widget.signedInUser.lname}",
|
||||
widget.signedInUser,
|
||||
"${mzansiProfileProvider.user!.fname} ${mzansiProfileProvider.user!.lname}",
|
||||
mzansiProfileProvider.user!,
|
||||
context,
|
||||
);
|
||||
if (statusCode == 200) {
|
||||
await MihAccessControlsServices()
|
||||
.getBusinessAccessListOfPatient(
|
||||
mzansiProfileProvider.user!.app_id,
|
||||
accessProvider,
|
||||
);
|
||||
context.pop();
|
||||
successPopUp("Successfully Actioned Request",
|
||||
"You have successfully Declined access request");
|
||||
@@ -384,15 +392,20 @@ class _BuildPatientsListState extends State<BuildBusinessAccessList> {
|
||||
print("request approved");
|
||||
int statusCode = await MihAccessControlsServices()
|
||||
.updatePatientAccessAPICall(
|
||||
widget.patientAccessList[index].business_id,
|
||||
widget.patientAccessList[index].requested_by,
|
||||
widget.patientAccessList[index].app_id,
|
||||
accessProvider.accessList![index].business_id,
|
||||
accessProvider.accessList![index].requested_by,
|
||||
accessProvider.accessList![index].app_id,
|
||||
"approved",
|
||||
"${widget.signedInUser.fname} ${widget.signedInUser.lname}",
|
||||
widget.signedInUser,
|
||||
"${mzansiProfileProvider.user!.fname} ${mzansiProfileProvider.user!.lname}",
|
||||
mzansiProfileProvider.user!,
|
||||
context,
|
||||
);
|
||||
if (statusCode == 200) {
|
||||
await MihAccessControlsServices()
|
||||
.getBusinessAccessListOfPatient(
|
||||
mzansiProfileProvider.user!.app_id,
|
||||
accessProvider,
|
||||
);
|
||||
context.pop();
|
||||
successPopUp("Successfully Actioned Request",
|
||||
"You have successfully Accepted access request");
|
||||
@@ -487,6 +500,16 @@ class _BuildPatientsListState extends State<BuildBusinessAccessList> {
|
||||
);
|
||||
}
|
||||
|
||||
List<PatientAccess> filterAccessList(List<PatientAccess> accessList) {
|
||||
if (widget.filterText == "All") {
|
||||
return accessList;
|
||||
}
|
||||
return accessList
|
||||
.where((item) =>
|
||||
item.status.toLowerCase() == widget.filterText.toLowerCase())
|
||||
.toList();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
@@ -500,6 +523,11 @@ class _BuildPatientsListState extends State<BuildBusinessAccessList> {
|
||||
height = size.height;
|
||||
});
|
||||
checkScreenSize();
|
||||
return Consumer2<MzansiProfileProvider, MihAccessControllsProvider>(
|
||||
builder: (BuildContext context,
|
||||
MzansiProfileProvider mzansiProfileProvider,
|
||||
MihAccessControllsProvider accessProvider,
|
||||
Widget? child) {
|
||||
return ListView.separated(
|
||||
shrinkWrap: true,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
@@ -509,11 +537,15 @@ class _BuildPatientsListState extends State<BuildBusinessAccessList> {
|
||||
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
|
||||
);
|
||||
},
|
||||
itemCount: widget.patientAccessList.length,
|
||||
itemCount: filterAccessList(accessProvider.accessList!).length,
|
||||
itemBuilder: (context, index) {
|
||||
//final patient = widget.patients[index].id_no.contains(widget.searchString);
|
||||
//print(index);
|
||||
return displayQueue(index);
|
||||
final filteredList = filterAccessList(accessProvider.accessList!);
|
||||
return displayQueue(
|
||||
mzansiProfileProvider, accessProvider, index, filteredList);
|
||||
},
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2,15 +2,14 @@ import 'package:go_router/go_router.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_action.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tools.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_objects/app_user.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_providers/mih_access_controlls_provider.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/access_review/package_tools/mih_access_requests.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class MihAccess extends StatefulWidget {
|
||||
final AppUser signedInUser;
|
||||
const MihAccess({
|
||||
super.key,
|
||||
required this.signedInUser,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -18,7 +17,6 @@ class MihAccess extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _MihAccessState extends State<MihAccess> {
|
||||
int _selcetedIndex = 0;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihPackage(
|
||||
@@ -26,12 +24,9 @@ class _MihAccessState extends State<MihAccess> {
|
||||
appTools: getTools(),
|
||||
appBody: getToolBody(),
|
||||
appToolTitles: getToolTitle(),
|
||||
selectedbodyIndex: _selcetedIndex,
|
||||
selectedbodyIndex: context.watch<MihAccessControllsProvider>().toolIndex,
|
||||
onIndexChange: (newValue) {
|
||||
setState(() {
|
||||
_selcetedIndex = newValue;
|
||||
});
|
||||
print("Index: $_selcetedIndex");
|
||||
context.read<MihAccessControllsProvider>().setToolIndex(newValue);
|
||||
},
|
||||
);
|
||||
}
|
||||
@@ -43,7 +38,6 @@ class _MihAccessState extends State<MihAccess> {
|
||||
onTap: () {
|
||||
context.goNamed(
|
||||
'mihHome',
|
||||
extra: true,
|
||||
);
|
||||
FocusScope.of(context).unfocus();
|
||||
},
|
||||
@@ -53,21 +47,17 @@ class _MihAccessState extends State<MihAccess> {
|
||||
MihPackageTools getTools() {
|
||||
Map<Widget, void Function()?> temp = {};
|
||||
temp[const Icon(Icons.people)] = () {
|
||||
setState(() {
|
||||
_selcetedIndex = 0;
|
||||
});
|
||||
context.read<MihAccessControllsProvider>().setToolIndex(0);
|
||||
};
|
||||
return MihPackageTools(
|
||||
tools: temp,
|
||||
selcetedIndex: _selcetedIndex,
|
||||
selcetedIndex: context.watch<MihAccessControllsProvider>().toolIndex,
|
||||
);
|
||||
}
|
||||
|
||||
List<Widget> getToolBody() {
|
||||
List<Widget> toolBodies = [
|
||||
MihAccessRequest(
|
||||
signedInUser: widget.signedInUser,
|
||||
),
|
||||
MihAccessRequest(),
|
||||
];
|
||||
return toolBodies;
|
||||
}
|
||||
|
||||
@@ -2,17 +2,14 @@ import 'package:go_router/go_router.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tile.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_icons.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_objects/app_user.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||
|
||||
class MihAccessTile extends StatefulWidget {
|
||||
final AppUser signedInUser;
|
||||
final double packageSize;
|
||||
|
||||
const MihAccessTile({
|
||||
super.key,
|
||||
required this.signedInUser,
|
||||
required this.packageSize,
|
||||
});
|
||||
|
||||
@@ -28,7 +25,6 @@ class _MihAccessTileState extends State<MihAccessTile> {
|
||||
onTap: () {
|
||||
context.goNamed(
|
||||
"mihAccess",
|
||||
extra: widget.signedInUser,
|
||||
);
|
||||
// Navigator.of(context).pushNamed(
|
||||
// '/mih-access',
|
||||
|
||||