diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml
index 35a11152d..0d45fc254 100644
--- a/.github/workflows/dart.yml
+++ b/.github/workflows/dart.yml
@@ -1,8 +1,3 @@
-# This workflow uses actions that are not certified by GitHub.
-# They are provided by a third-party and are governed by
-# separate terms of service, privacy policy, and support
-# documentation.
-
name: Run analysis and tests
on:
@@ -22,7 +17,13 @@ jobs:
- name: Flutter action
uses: subosito/flutter-action@v2.8.0
with:
- flutter-version: "3.16.5"
+ flutter-version: "3.22.1"
+
+ - name: Clean previous builds
+ run: flutter clean
+
+ - name: Install dependencies
+ run: flutter pub get
- name: Generate models
run: ./tools/install_bricks.sh
diff --git a/.github/workflows/flutter-build-apk.yml b/.github/workflows/flutter-build-apk.yml
new file mode 100644
index 000000000..a8995a1b0
--- /dev/null
+++ b/.github/workflows/flutter-build-apk.yml
@@ -0,0 +1,75 @@
+name: Build APK Workflow
+
+on:
+ push:
+ branches: [ 'develop', 'master' ] # This specifies that the workflow will run on any push to the 'develop' or 'master' branches
+ pull_request:
+ branches: [ 'develop', 'master' ] # Optionally, run on pull requests targeting the 'develop' or 'master' branches
+
+jobs:
+ build-apk:
+ runs-on: ubuntu-latest
+ environment: UAT
+
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v3
+
+ - name: Set up JDK 17
+ uses: actions/setup-java@v3
+ with:
+ java-version: '17'
+ distribution: 'temurin' # Specify the Java distribution
+
+ - name: Flutter action
+ uses: subosito/flutter-action@v2.8.0
+ with:
+ flutter-version: "3.22.2"
+
+ - name: Set up Android SDK
+ uses: android-actions/setup-android@v2
+ with:
+ api-level: 33
+ build-tools: 33.0.2
+
+ - name: Install Dependencies
+ run: flutter pub get
+
+ - name: Create .env file
+ run: |
+ echo "BASE_URL=${{ vars.BASE_URL }}" >> apps/health_campaign_field_worker_app/.env
+ echo "MDMS_API_PATH=${{ vars.MDMS_API_PATH }}" >> apps/health_campaign_field_worker_app/.env
+ echo "TENANT_ID=${{ vars.TENANT_ID }}" >> apps/health_campaign_field_worker_app/.env
+ echo "ACTIONS_API_PATH=${{ vars.ACTIONS_API_PATH }}" >> apps/health_campaign_field_worker_app/.env
+ echo "SYNC_DOWN_RETRY_COUNT=${{ vars.SYNC_DOWN_RETRY_COUNT }}" >> apps/health_campaign_field_worker_app/.env
+ echo "RETRY_TIME_INTERVAL=${{ vars.RETRY_TIME_INTERVAL }}" >> apps/health_campaign_field_worker_app/.env
+ echo "CONNECT_TIMEOUT=${{ vars.CONNECT_TIMEOUT }}" >> apps/health_campaign_field_worker_app/.env
+ echo "RECEIVE_TIMEOUT=${{ vars.RECEIVE_TIMEOUT }}" >> apps/health_campaign_field_worker_app/.env
+ echo "SEND_TIMEOUT=${{ vars.SEND_TIMEOUT }}" >> apps/health_campaign_field_worker_app/.env
+ echo "CHECK_BANDWIDTH_API=${{ vars.CHECK_BANDWIDTH_API }}" >> apps/health_campaign_field_worker_app/.env
+ echo "HIERARCHY_TYPE=${{ vars.HIERARCHY_TYPE }}" >> apps/health_campaign_field_worker_app/.env
+ echo "ENV_NAME=${{ vars.ENV_NAME }}" >> apps/health_campaign_field_worker_app/.env
+
+ - name: Verify .env file
+ run: |
+ ls -l apps/health_campaign_field_worker_app/.env
+ cat apps/health_campaign_field_worker_app/.env
+
+ - name: Run APK build script
+ env:
+ BUILD_CONFIG: release # or profile depending on your choice
+ run: bash ./tools/generate-apk.sh
+
+ # Archive the APK as a build artifact so it can be downloaded
+ - name: Upload APKs
+ uses: actions/upload-artifact@v3
+ with:
+ name: app-release-apk
+ path: apps/health_campaign_field_worker_app/build/app/outputs/flutter-apk/app-release.apk
+
+ - name: Upload .env as artifact
+ uses: actions/upload-artifact@v3
+ with:
+ name: env-file
+ path: apps/health_campaign_field_worker_app/.env
+ include-hidden-files: true
diff --git a/apps/health_campaign_field_worker_app/android/app/build.gradle b/apps/health_campaign_field_worker_app/android/app/build.gradle
index 7ed3cf689..614262029 100644
--- a/apps/health_campaign_field_worker_app/android/app/build.gradle
+++ b/apps/health_campaign_field_worker_app/android/app/build.gradle
@@ -1,3 +1,10 @@
+plugins {
+ id 'com.android.application'
+ id 'kotlin-android'
+ id 'dev.flutter.flutter-gradle-plugin'
+ id 'com.google.gms.google-services'
+}
+
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
@@ -6,11 +13,6 @@ if (localPropertiesFile.exists()) {
}
}
-def flutterRoot = localProperties.getProperty('flutter.sdk')
-if (flutterRoot == null) {
- throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
-}
-
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
@@ -21,24 +23,18 @@ if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
-apply plugin: 'com.android.application'
-// START: FlutterFire Configuration
-apply plugin: 'com.google.gms.google-services'
-// END: FlutterFire Configuration
-apply plugin: 'kotlin-android'
-apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
- compileSdkVersion 34
+ compileSdk = flutter.compileSdkVersion
ndkVersion flutter.ndkVersion
compileOptions {
- sourceCompatibility JavaVersion.VERSION_1_8
- targetCompatibility JavaVersion.VERSION_1_8
+ sourceCompatibility JavaVersion.VERSION_17
+ targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
- jvmTarget = '1.8'
+ jvmTarget = '17'
}
sourceSets {
@@ -50,8 +46,8 @@ android {
applicationId "com.digit.hcm"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
- minSdkVersion 21
- targetSdkVersion flutter.targetSdkVersion
+ minSdk = flutter.minSdkVersion
+ targetSdk = flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
@@ -63,12 +59,16 @@ android {
signingConfig signingConfigs.debug
}
}
+
+ if (!project.hasProperty('USE_GOOGLE_SERVICES')) {
+ tasks.whenTaskAdded { task ->
+ if (task.name.contains("GoogleServices")) {
+ task.enabled = false
+ }
+ }
+ }
}
flutter {
source '../..'
-}
-
-dependencies {
- implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
-}
+}
\ No newline at end of file
diff --git a/apps/health_campaign_field_worker_app/android/app/src/main/AndroidManifest.xml b/apps/health_campaign_field_worker_app/android/app/src/main/AndroidManifest.xml
index 8599cae8b..5f39e8455 100644
--- a/apps/health_campaign_field_worker_app/android/app/src/main/AndroidManifest.xml
+++ b/apps/health_campaign_field_worker_app/android/app/src/main/AndroidManifest.xml
@@ -3,6 +3,7 @@
+
@@ -10,7 +11,7 @@
-
+
@@ -28,16 +29,16 @@
android:allowBackup="false"
- android:fullBackupOnly="false"
android:fullBackupContent="false"
+ android:fullBackupOnly="false"
+ android:icon="@mipmap/ic_launcher"
+ android:label="HCM">
+ android:exported="false"
+ android:foregroundServiceType="location" />
-
-
+
+ MethodChannel(
+ flutterEngine!!.dartExecutor.binaryMessenger,
+ CHANNEL
+ ).setMethodCallHandler { call, result ->
when (call.method) {
"startLocationUpdates" -> {
val interval = (call.argument("interval")?.toLong()) ?: 60000L
- val stopAfterTimestamp = (call.argument("stopAfterTimestamp")?.toLong()) ?: (System.currentTimeMillis() + 60000L)
+ val stopAfterTimestamp = (call.argument("stopAfterTimestamp")?.toLong())
+ ?: (System.currentTimeMillis() + 60000L)
if (!isMyServiceRunning(LocationService::class.java)) {
startService(interval, stopAfterTimestamp)
} else {
- Toast.makeText(this, "Location service is already running", Toast.LENGTH_SHORT).show()
+ Toast.makeText(
+ this,
+ "Location service is already running",
+ Toast.LENGTH_SHORT
+ ).show()
}
result.success(null)
}
+
"stopLocationUpdates" -> {
stopService()
result.success(null)
}
+
else -> result.notImplemented()
}
}
- // Register the receiver for location updates
+ // Register the receiver for location updates, with proper export settings for Android 13+
val filter = IntentFilter("LocationUpdate")
- registerReceiver(locationReceiver, filter)
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
+ registerReceiver(locationReceiver, filter, Context.RECEIVER_EXPORTED)
+ } else {
+ registerReceiver(locationReceiver, filter)
+ }
}
override fun onDestroy() {
@@ -90,7 +112,8 @@ class MainActivity : FlutterActivity() {
val manager = getSystemService(Context.ACTIVITY_SERVICE) as android.app.ActivityManager
for (service in manager.getRunningServices(Int.MAX_VALUE)) {
if (serviceClass.name == service.service.className) {
- Toast.makeText(this, "Location service is already running", Toast.LENGTH_SHORT).show()
+ Toast.makeText(this, "Location service is already running", Toast.LENGTH_SHORT)
+ .show()
return true
}
}
diff --git a/apps/health_campaign_field_worker_app/android/app/src/main/kotlin/com/digit/hcm/location_service.kt b/apps/health_campaign_field_worker_app/android/app/src/main/kotlin/com/digit/hcm/location_service.kt
index 930d4a408..23756ee0e 100644
--- a/apps/health_campaign_field_worker_app/android/app/src/main/kotlin/com/digit/hcm/location_service.kt
+++ b/apps/health_campaign_field_worker_app/android/app/src/main/kotlin/com/digit/hcm/location_service.kt
@@ -92,10 +92,11 @@ class LocationService : Service() {
val intent = Intent("LocationUpdate")
intent.putExtra("latitude", location.latitude)
intent.putExtra("longitude", location.longitude)
+ intent.putExtra("accuracy", location.accuracy)
sendBroadcast(intent)
- Log.d("LocationSharing", "Location sent to MainActivity: Latitude ${location.latitude}, Longitude ${location.longitude}")
+ Log.d("LocationSharing", "Location sent to MainActivity: Latitude ${location.latitude}, Longitude ${location.longitude}, Accuracy ${location.accuracy}")
}
override fun onDestroy() {
@@ -129,8 +130,10 @@ class LocationService : Service() {
val notificationIntent = Intent(this, MainActivity::class.java)
val pendingIntent = PendingIntent.getActivity(this, 0, notificationIntent, PendingIntent.FLAG_IMMUTABLE)
val timestamp = System.currentTimeMillis()
- val notificationContent = "Latitude: ${location.latitude}, Longitude: ${location.longitude},"
- writeToFile("Latitude: ${location.latitude}, Longitude: ${location.longitude}, isSync: false, timestamp: $timestamp")
+ val notificationContent = "Latitude: ${location.latitude}, Longitude: ${location.longitude}, Accuracy: ${location.accuracy}" // Include accuracy
+
+ // Write location and accuracy to file
+ writeToFile("Latitude: ${location.latitude}, Longitude: ${location.longitude}, Accuracy: ${location.accuracy}, isSync: false, timestamp: $timestamp")
val notification = NotificationCompat.Builder(this, CHANNEL_ID)
.setContentTitle("Location Service")
diff --git a/apps/health_campaign_field_worker_app/android/build.gradle b/apps/health_campaign_field_worker_app/android/build.gradle
index 240f9a683..bc157bd1a 100644
--- a/apps/health_campaign_field_worker_app/android/build.gradle
+++ b/apps/health_campaign_field_worker_app/android/build.gradle
@@ -1,19 +1,3 @@
-buildscript {
- ext.kotlin_version = '1.8.22'
- repositories {
- google()
- mavenCentral()
- }
-
- dependencies {
- classpath 'com.android.tools.build:gradle:7.1.2'
- // START: FlutterFire Configuration
- classpath 'com.google.gms:google-services:4.3.10'
- // END: FlutterFire Configuration
- classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
- }
-}
-
allprojects {
repositories {
google()
diff --git a/apps/health_campaign_field_worker_app/android/gradle/wrapper/gradle-wrapper.properties b/apps/health_campaign_field_worker_app/android/gradle/wrapper/gradle-wrapper.properties
index cb24abda1..41dfb8790 100644
--- a/apps/health_campaign_field_worker_app/android/gradle/wrapper/gradle-wrapper.properties
+++ b/apps/health_campaign_field_worker_app/android/gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
diff --git a/apps/health_campaign_field_worker_app/android/settings.gradle b/apps/health_campaign_field_worker_app/android/settings.gradle
index 44e62bcf0..a9fc22210 100644
--- a/apps/health_campaign_field_worker_app/android/settings.gradle
+++ b/apps/health_campaign_field_worker_app/android/settings.gradle
@@ -1,11 +1,27 @@
-include ':app'
+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
+ }()
-def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
-def properties = new Properties()
+ includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
-assert localPropertiesFile.exists()
-localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
+ repositories {
+ google()
+ mavenCentral()
+ gradlePluginPortal()
+ }
+}
-def flutterSdkPath = properties.getProperty("flutter.sdk")
-assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
-apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
+plugins {
+ id "dev.flutter.flutter-plugin-loader" version "1.0.0"
+ id "com.android.application" version "7.3.0" apply false
+ id "org.jetbrains.kotlin.android" version "1.8.22" apply false
+ id "com.google.gms.google-services" version "4.4.0" apply false
+ id "com.google.firebase.crashlytics" version "2.9.9" apply false
+}
+
+include ":app"
\ No newline at end of file
diff --git a/apps/health_campaign_field_worker_app/assets/animated_json/inline_loader.json b/apps/health_campaign_field_worker_app/assets/animated_json/inline_loader.json
new file mode 100644
index 000000000..e5a3cc656
--- /dev/null
+++ b/apps/health_campaign_field_worker_app/assets/animated_json/inline_loader.json
@@ -0,0 +1 @@
+{"nm":"Main Scene","ddd":0,"h":500,"w":500,"meta":{"g":"@lottiefiles/creator 1.37.0"},"layers":[{"ty":4,"nm":"Shape Layer 5","sr":1,"st":20,"op":620,"ip":20,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[251,250]},"r":{"a":1,"k":[{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[0],"t":20},{"s":[360],"t":110}]},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}},"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Ellipse 1","ix":1,"cix":2,"np":3,"it":[{"ty":"el","bm":0,"hd":false,"mn":"ADBE Vector Shape - Ellipse","nm":"Ellipse Path 1","d":1,"p":{"a":0,"k":[0,-100]},"s":{"a":0,"k":[10,10]}},{"ty":"st","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Stroke","nm":"Stroke 1","lc":1,"lj":1,"ml":4,"o":{"a":0,"k":100},"w":{"a":0,"k":0},"c":{"a":0,"k":[0,0,0]}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0.7765,0.2902,0.051]},"r":1,"o":{"a":0,"k":100}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":1},{"ty":4,"nm":"Shape Layer 4","sr":1,"st":15,"op":615,"ip":15,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[251,250]},"r":{"a":1,"k":[{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[0],"t":15},{"s":[360],"t":105}]},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}},"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Ellipse 1","ix":1,"cix":2,"np":3,"it":[{"ty":"el","bm":0,"hd":false,"mn":"ADBE Vector Shape - Ellipse","nm":"Ellipse Path 1","d":1,"p":{"a":0,"k":[0,-100]},"s":{"a":0,"k":[20,20]}},{"ty":"st","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Stroke","nm":"Stroke 1","lc":1,"lj":1,"ml":4,"o":{"a":0,"k":100},"w":{"a":0,"k":0},"c":{"a":0,"k":[0,0,0]}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0.7765,0.2902,0.051]},"r":1,"o":{"a":0,"k":100}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":2},{"ty":4,"nm":"Shape Layer 3","sr":1,"st":10,"op":610,"ip":10,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[251,250]},"r":{"a":1,"k":[{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[0],"t":10},{"s":[360],"t":100}]},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}},"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Ellipse 1","ix":1,"cix":2,"np":3,"it":[{"ty":"el","bm":0,"hd":false,"mn":"ADBE Vector Shape - Ellipse","nm":"Ellipse Path 1","d":1,"p":{"a":0,"k":[0,-100]},"s":{"a":0,"k":[30,30]}},{"ty":"st","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Stroke","nm":"Stroke 1","lc":1,"lj":1,"ml":4,"o":{"a":0,"k":100},"w":{"a":0,"k":0},"c":{"a":0,"k":[0,0,0]}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0.7765,0.2902,0.051]},"r":1,"o":{"a":0,"k":100}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":3},{"ty":4,"nm":"Shape Layer 2","sr":1,"st":5,"op":605,"ip":5,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[251,250]},"r":{"a":1,"k":[{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[0],"t":5},{"s":[360],"t":95}]},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}},"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Ellipse 1","ix":1,"cix":2,"np":3,"it":[{"ty":"el","bm":0,"hd":false,"mn":"ADBE Vector Shape - Ellipse","nm":"Ellipse Path 1","d":1,"p":{"a":0,"k":[0,-100]},"s":{"a":0,"k":[40,40]}},{"ty":"st","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Stroke","nm":"Stroke 1","lc":1,"lj":1,"ml":4,"o":{"a":0,"k":100},"w":{"a":0,"k":0},"c":{"a":0,"k":[0,0,0]}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0.7765,0.2902,0.051]},"r":1,"o":{"a":0,"k":100}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":4},{"ty":4,"nm":"Shape Layer 1","sr":1,"st":0,"op":600,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[250,250]},"r":{"a":1,"k":[{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[0],"t":0},{"s":[360],"t":90}]},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}},"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Ellipse 1","ix":1,"cix":2,"np":3,"it":[{"ty":"el","bm":0,"hd":false,"mn":"ADBE Vector Shape - Ellipse","nm":"Ellipse Path 1","d":1,"p":{"a":0,"k":[0,-100]},"s":{"a":1,"k":[{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[50,50],"t":0},{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[40,40],"t":84},{"s":[50,50],"t":100}]}},{"ty":"st","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Stroke","nm":"Stroke 1","lc":1,"lj":1,"ml":4,"o":{"a":0,"k":100},"w":{"a":0,"k":0},"c":{"a":0,"k":[0,0,0]}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0.7765,0.2902,0.051]},"r":1,"o":{"a":0,"k":100}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":5}],"v":"5.7.0","fr":60,"op":106,"ip":0,"assets":[]}
\ No newline at end of file
diff --git a/apps/health_campaign_field_worker_app/assets/animated_json/overlay_loader.json b/apps/health_campaign_field_worker_app/assets/animated_json/overlay_loader.json
new file mode 100644
index 000000000..9a9759f2d
--- /dev/null
+++ b/apps/health_campaign_field_worker_app/assets/animated_json/overlay_loader.json
@@ -0,0 +1 @@
+{"nm":"Main Scene","ddd":0,"h":500,"w":500,"meta":{"g":"@lottiefiles/creator 1.37.1"},"layers":[{"ty":4,"nm":"Shape Layer 5","sr":1,"st":20,"op":620,"ip":20,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[251,250]},"r":{"a":1,"k":[{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[0],"t":20},{"s":[360],"t":110}]},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}},"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Ellipse 1","ix":1,"cix":2,"np":3,"it":[{"ty":"el","bm":0,"hd":false,"mn":"ADBE Vector Shape - Ellipse","nm":"Ellipse Path 1","d":1,"p":{"a":0,"k":[0,-100]},"s":{"a":0,"k":[10,10]}},{"ty":"st","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Stroke","nm":"Stroke 1","lc":1,"lj":1,"ml":4,"o":{"a":0,"k":100},"w":{"a":0,"k":0},"c":{"a":0,"k":[0,0,0]}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[1,1,1]},"r":1,"o":{"a":0,"k":100}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":1},{"ty":4,"nm":"Shape Layer 4","sr":1,"st":15,"op":615,"ip":15,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[251,250]},"r":{"a":1,"k":[{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[0],"t":15},{"s":[360],"t":105}]},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}},"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Ellipse 1","ix":1,"cix":2,"np":3,"it":[{"ty":"el","bm":0,"hd":false,"mn":"ADBE Vector Shape - Ellipse","nm":"Ellipse Path 1","d":1,"p":{"a":0,"k":[0,-100]},"s":{"a":0,"k":[20,20]}},{"ty":"st","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Stroke","nm":"Stroke 1","lc":1,"lj":1,"ml":4,"o":{"a":0,"k":100},"w":{"a":0,"k":0},"c":{"a":0,"k":[0,0,0]}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[1,1,1]},"r":1,"o":{"a":0,"k":100}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":2},{"ty":4,"nm":"Shape Layer 3","sr":1,"st":10,"op":610,"ip":10,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[251,250]},"r":{"a":1,"k":[{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[0],"t":10},{"s":[360],"t":100}]},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}},"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Ellipse 1","ix":1,"cix":2,"np":3,"it":[{"ty":"el","bm":0,"hd":false,"mn":"ADBE Vector Shape - Ellipse","nm":"Ellipse Path 1","d":1,"p":{"a":0,"k":[0,-100]},"s":{"a":0,"k":[30,30]}},{"ty":"st","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Stroke","nm":"Stroke 1","lc":1,"lj":1,"ml":4,"o":{"a":0,"k":100},"w":{"a":0,"k":0},"c":{"a":0,"k":[0,0,0]}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[1,1,1]},"r":1,"o":{"a":0,"k":100}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":3},{"ty":4,"nm":"Shape Layer 2","sr":1,"st":5,"op":605,"ip":5,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[251,250]},"r":{"a":1,"k":[{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[0],"t":5},{"s":[360],"t":95}]},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}},"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Ellipse 1","ix":1,"cix":2,"np":3,"it":[{"ty":"el","bm":0,"hd":false,"mn":"ADBE Vector Shape - Ellipse","nm":"Ellipse Path 1","d":1,"p":{"a":0,"k":[0,-100]},"s":{"a":0,"k":[40,40]}},{"ty":"st","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Stroke","nm":"Stroke 1","lc":1,"lj":1,"ml":4,"o":{"a":0,"k":100},"w":{"a":0,"k":0},"c":{"a":0,"k":[0,0,0]}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[1,1,1]},"r":1,"o":{"a":0,"k":100}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":4},{"ty":4,"nm":"Shape Layer 1","sr":1,"st":0,"op":600,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[250,250]},"r":{"a":1,"k":[{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[0],"t":0},{"s":[360],"t":90}]},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}},"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Ellipse 1","ix":1,"cix":2,"np":3,"it":[{"ty":"el","bm":0,"hd":false,"mn":"ADBE Vector Shape - Ellipse","nm":"Ellipse Path 1","d":1,"p":{"a":0,"k":[0,-100]},"s":{"a":1,"k":[{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[50,50],"t":0},{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[40,40],"t":84},{"s":[50,50],"t":100}]}},{"ty":"st","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Stroke","nm":"Stroke 1","lc":1,"lj":1,"ml":4,"o":{"a":0,"k":100},"w":{"a":0,"k":0},"c":{"a":0,"k":[0,0,0]}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[1,1,1]},"r":1,"o":{"a":0,"k":100}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":5}],"v":"5.7.0","fr":60,"op":106,"ip":0,"assets":[]}
\ No newline at end of file
diff --git a/apps/health_campaign_field_worker_app/assets/animated_json/page_loader.json b/apps/health_campaign_field_worker_app/assets/animated_json/page_loader.json
new file mode 100644
index 000000000..ef02f47ca
--- /dev/null
+++ b/apps/health_campaign_field_worker_app/assets/animated_json/page_loader.json
@@ -0,0 +1 @@
+{"nm":"Main Scene","ddd":0,"h":500,"w":500,"meta":{"g":"@lottiefiles/creator 1.37.1"},"layers":[{"ty":4,"nm":"Shape Layer 5","sr":1,"st":20,"op":620,"ip":20,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[251,250]},"r":{"a":1,"k":[{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[0],"t":20},{"s":[360],"t":110}]},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}},"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Ellipse 1","ix":1,"cix":2,"np":3,"it":[{"ty":"el","bm":0,"hd":false,"mn":"ADBE Vector Shape - Ellipse","nm":"Ellipse Path 1","d":1,"p":{"a":0,"k":[0,-100]},"s":{"a":0,"k":[10,10]}},{"ty":"st","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Stroke","nm":"Stroke 1","lc":1,"lj":1,"ml":4,"o":{"a":0,"k":100},"w":{"a":0,"k":0},"c":{"a":0,"k":[0,0,0]}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0.0353,0.2902,0.4]},"r":1,"o":{"a":0,"k":100}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":1},{"ty":4,"nm":"Shape Layer 4","sr":1,"st":15,"op":615,"ip":15,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[251,250]},"r":{"a":1,"k":[{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[0],"t":15},{"s":[360],"t":105}]},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}},"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Ellipse 1","ix":1,"cix":2,"np":3,"it":[{"ty":"el","bm":0,"hd":false,"mn":"ADBE Vector Shape - Ellipse","nm":"Ellipse Path 1","d":1,"p":{"a":0,"k":[0,-100]},"s":{"a":0,"k":[20,20]}},{"ty":"st","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Stroke","nm":"Stroke 1","lc":1,"lj":1,"ml":4,"o":{"a":0,"k":100},"w":{"a":0,"k":0},"c":{"a":0,"k":[0,0,0]}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0.0353,0.2902,0.4]},"r":1,"o":{"a":0,"k":100}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":2},{"ty":4,"nm":"Shape Layer 3","sr":1,"st":10,"op":610,"ip":10,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[251,250]},"r":{"a":1,"k":[{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[0],"t":10},{"s":[360],"t":100}]},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}},"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Ellipse 1","ix":1,"cix":2,"np":3,"it":[{"ty":"el","bm":0,"hd":false,"mn":"ADBE Vector Shape - Ellipse","nm":"Ellipse Path 1","d":1,"p":{"a":0,"k":[0,-100]},"s":{"a":0,"k":[30,30]}},{"ty":"st","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Stroke","nm":"Stroke 1","lc":1,"lj":1,"ml":4,"o":{"a":0,"k":100},"w":{"a":0,"k":0},"c":{"a":0,"k":[0,0,0]}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0.0353,0.2902,0.4]},"r":1,"o":{"a":0,"k":100}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":3},{"ty":4,"nm":"Shape Layer 2","sr":1,"st":5,"op":605,"ip":5,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[251,250]},"r":{"a":1,"k":[{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[0],"t":5},{"s":[360],"t":95}]},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}},"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Ellipse 1","ix":1,"cix":2,"np":3,"it":[{"ty":"el","bm":0,"hd":false,"mn":"ADBE Vector Shape - Ellipse","nm":"Ellipse Path 1","d":1,"p":{"a":0,"k":[0,-100]},"s":{"a":0,"k":[40,40]}},{"ty":"st","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Stroke","nm":"Stroke 1","lc":1,"lj":1,"ml":4,"o":{"a":0,"k":100},"w":{"a":0,"k":0},"c":{"a":0,"k":[0,0,0]}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0.0353,0.2902,0.4]},"r":1,"o":{"a":0,"k":100}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":4},{"ty":4,"nm":"Shape Layer 1","sr":1,"st":0,"op":600,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[250,250]},"r":{"a":1,"k":[{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[0],"t":0},{"s":[360],"t":90}]},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}},"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Ellipse 1","ix":1,"cix":2,"np":3,"it":[{"ty":"el","bm":0,"hd":false,"mn":"ADBE Vector Shape - Ellipse","nm":"Ellipse Path 1","d":1,"p":{"a":0,"k":[0,-100]},"s":{"a":1,"k":[{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[50,50],"t":0},{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[40,40],"t":84},{"s":[50,50],"t":100}]}},{"ty":"st","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Stroke","nm":"Stroke 1","lc":1,"lj":1,"ml":4,"o":{"a":0,"k":100},"w":{"a":0,"k":0},"c":{"a":0,"k":[0,0,0]}},{"ty":"fl","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0.0353,0.2902,0.4]},"r":1,"o":{"a":0,"k":100}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":5}],"v":"5.7.0","fr":60,"op":106,"ip":0,"assets":[]}
\ No newline at end of file
diff --git a/apps/health_campaign_field_worker_app/lib/app.dart b/apps/health_campaign_field_worker_app/lib/app.dart
index 531d0295c..b5fa3fb6c 100644
--- a/apps/health_campaign_field_worker_app/lib/app.dart
+++ b/apps/health_campaign_field_worker_app/lib/app.dart
@@ -1,5 +1,4 @@
import 'package:attendance_management/attendance_management.dart';
-import 'package:survey_form/survey_form.dart';
import 'package:closed_household/blocs/closed_household.dart';
import 'package:closed_household/closed_household.dart';
import 'package:digit_components/digit_components.dart';
@@ -19,6 +18,7 @@ import 'package:registration_delivery/models/entities/household.dart';
import 'package:registration_delivery/models/entities/household_member.dart';
import 'package:registration_delivery/models/entities/project_beneficiary.dart';
import 'package:registration_delivery/models/entities/task.dart';
+import 'package:survey_form/survey_form.dart';
import 'blocs/app_initialization/app_initialization.dart';
import 'blocs/auth/auth.dart';
@@ -184,13 +184,8 @@ class MainApplicationState extends State
widget.sql)
..add(
LocalizationEvent.onLoadLocalization(
- module: localizationModulesList.interfaces
- .where((element) =>
- element.type ==
- Modules.localizationModule)
- .map((e) => e.name.toString())
- .join(',')
- .toString(),
+ module:
+ "hcm-boundary-${envConfig.variables.hierarchyType.toLowerCase()},${localizationModulesList.interfaces.where((element) => element.type == Modules.localizationModule).map((e) => e.name.toString()).join(',')}",
tenantId: appConfig.tenantId.toString(),
locale: firstLanguage,
path: Constants.localizationApiPath,
diff --git a/apps/health_campaign_field_worker_app/lib/blocs/project/project.dart b/apps/health_campaign_field_worker_app/lib/blocs/project/project.dart
index 3be8eec58..07347633e 100644
--- a/apps/health_campaign_field_worker_app/lib/blocs/project/project.dart
+++ b/apps/health_campaign_field_worker_app/lib/blocs/project/project.dart
@@ -161,8 +161,8 @@ class ProjectBloc extends Bloc {
title: 'ProjectBloc',
);
- final isOnline = connectivityResult == ConnectivityResult.wifi ||
- connectivityResult == ConnectivityResult.mobile;
+ final isOnline = connectivityResult.firstOrNull == ConnectivityResult.wifi ||
+ connectivityResult.firstOrNull == ConnectivityResult.mobile;
final selectedProject = await localSecureStore.selectedProject;
final isProjectSetUpComplete = await localSecureStore
.isProjectSetUpComplete(selectedProject?.id ?? "noProjectId");
diff --git a/apps/health_campaign_field_worker_app/lib/blocs/projects_beneficiary_downsync/project_beneficiaries_downsync.dart b/apps/health_campaign_field_worker_app/lib/blocs/projects_beneficiary_downsync/project_beneficiaries_downsync.dart
index a443250b1..61c278aeb 100644
--- a/apps/health_campaign_field_worker_app/lib/blocs/projects_beneficiary_downsync/project_beneficiaries_downsync.dart
+++ b/apps/health_campaign_field_worker_app/lib/blocs/projects_beneficiary_downsync/project_beneficiaries_downsync.dart
@@ -2,14 +2,14 @@
import 'dart:async';
import 'package:digit_data_model/data_model.dart';
-import 'package:disk_space/disk_space.dart';
+import 'package:disk_space_update/disk_space_update.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:registration_delivery/registration_delivery.dart';
+import 'package:sync_service/sync_service_lib.dart';
import '../../data/local_store/no_sql/schema/app_configuration.dart';
import '../../data/local_store/secure_store/secure_store.dart';
-import '../../data/network_manager.dart';
import '../../data/repositories/remote/bandwidth_check.dart';
import '../../models/downsync/downsync.dart';
import '../../utils/background_service.dart';
@@ -27,7 +27,6 @@ class BeneficiaryDownSyncBloc
downSyncRemoteRepository;
final LocalRepository
downSyncLocalRepository;
- final NetworkManager networkManager;
final BandwidthCheckRepository bandwidthCheckRepository;
final LocalRepository
householdLocalRepository;
@@ -39,12 +38,11 @@ class BeneficiaryDownSyncBloc
final LocalRepository
sideEffectLocalRepository;
final LocalRepository
- referralLocalRepository;
+ referralLocalRepository;
BeneficiaryDownSyncBloc({
required this.individualLocalRepository,
required this.downSyncRemoteRepository,
required this.downSyncLocalRepository,
- required this.networkManager,
required this.bandwidthCheckRepository,
required this.householdLocalRepository,
required this.householdMemberLocalRepository,
@@ -203,7 +201,9 @@ class BeneficiaryDownSyncBloc
);
// check if the API response is there or it failed
if (downSyncResults.isNotEmpty) {
- await networkManager.writeToEntityDB(downSyncResults, [
+ await SyncServiceSingleton()
+ .entityMapper
+ ?.writeToEntityDB(downSyncResults, [
individualLocalRepository,
householdLocalRepository,
householdMemberLocalRepository,
diff --git a/apps/health_campaign_field_worker_app/lib/data/data_manager.dart b/apps/health_campaign_field_worker_app/lib/data/data_manager.dart
deleted file mode 100644
index 7d649d73e..000000000
--- a/apps/health_campaign_field_worker_app/lib/data/data_manager.dart
+++ /dev/null
@@ -1,35 +0,0 @@
-import 'dart:async';
-
-import 'package:digit_data_model/data_model.dart';
-
-class DataManager {
- final RemoteRepository remoteRepository;
- final LocalRepository localRepository;
- final PersistenceConfiguration configuration;
-
- const DataManager({
- required this.localRepository,
- required this.remoteRepository,
- required this.configuration,
- });
-
- DataRepository _getRepository(PersistenceConfiguration configuration) {
- switch (configuration) {
- case PersistenceConfiguration.offline:
- return localRepository;
- case PersistenceConfiguration.online:
- return remoteRepository;
- }
- }
-
- FutureOr> search(R query) =>
- _getRepository(configuration).search(query);
-
- FutureOr create(D entity) =>
- _getRepository(configuration).create(entity);
-
- FutureOr update(D entity) =>
- _getRepository(configuration).update(entity);
-}
-
-enum PersistenceConfiguration { offline, online }
diff --git a/apps/health_campaign_field_worker_app/lib/data/network_manager.dart b/apps/health_campaign_field_worker_app/lib/data/network_manager.dart
index 744577530..34125ce56 100644
--- a/apps/health_campaign_field_worker_app/lib/data/network_manager.dart
+++ b/apps/health_campaign_field_worker_app/lib/data/network_manager.dart
@@ -1,18 +1,6 @@
-import 'dart:async';
-import 'dart:convert';
-
import 'package:digit_data_model/data_model.dart';
import 'package:flutter/cupertino.dart';
-import 'package:flutter/foundation.dart';
-import 'package:flutter_background_service/flutter_background_service.dart';
import 'package:provider/provider.dart';
-import 'package:registration_delivery/registration_delivery.dart';
-
-import '../models/bandwidth/bandwidth_model.dart';
-import 'local_store/secure_store/secure_store.dart';
-import 'repositories/sync/remote_type.dart';
-import 'repositories/sync/sync_down.dart';
-import 'repositories/sync/sync_up.dart';
class NetworkManager {
final NetworkManagerConfiguration configuration;
@@ -30,194 +18,6 @@ class NetworkManager {
return context.read>();
}
}
-
-/* This function will read the params and get the records which are not synced
- and pushes to the sync-up and sync-down methods */
-
- FutureOr performSync({
- required List localRepositories,
- required List remoteRepositories,
- required BandwidthModel bandwidthModel,
- ServiceInstance? service,
- }) async {
- if (configuration.persistenceConfig ==
- PersistenceConfiguration.onlineOnly) {
- throw Exception('Sync up is not valid for online only configuration');
- }
- bool isSyncCompleted = false;
-
- final futuresSyncDown = await Future.wait(
- localRepositories
- .map((e) => e.getItemsToBeSyncedDown(bandwidthModel.userId)),
- );
- final pendingSyncDownEntries = futuresSyncDown.expand((e) => e).toList();
-
- final futuresSyncUp = await Future.wait(
- localRepositories
- .map((e) => e.getItemsToBeSyncedUp(bandwidthModel.userId)),
- );
- final pendingSyncUpEntries = futuresSyncUp.expand((e) => e).toList();
-
- SyncError? syncError;
-
-// Perform the sync Down Operation
-
- try {
- await PerformSyncDown.syncDown(
- bandwidthModel: bandwidthModel,
- localRepositories: localRepositories.toSet().toList(),
- remoteRepositories: remoteRepositories.toSet().toList(),
- configuration: configuration,
- );
- } catch (e) {
- syncError = SyncDownError(e);
- service?.stopSelf();
- }
-
-// Perform the sync up Operation
-
- try {
- await PerformSyncUp.syncUp(
- bandwidthModel: bandwidthModel,
- localRepositories: localRepositories.toSet().toList(),
- remoteRepositories: remoteRepositories.toSet().toList(),
- );
- } catch (e) {
- if (kDebugMode) {
- print('Sync Up Error: $e');
- }
- syncError ??= SyncUpError(e);
- service?.stopSelf();
- }
-
- if (syncError != null) throw syncError;
-
- // Recursive function which will call the Perfom Sync
-
- if (pendingSyncUpEntries.isNotEmpty || pendingSyncDownEntries.isNotEmpty) {
- await Future.delayed(const Duration(seconds: 3));
- isSyncCompleted = await performSync(
- bandwidthModel: bandwidthModel,
- localRepositories: localRepositories,
- remoteRepositories: remoteRepositories,
- );
- } else if (pendingSyncUpEntries.isEmpty && pendingSyncDownEntries.isEmpty) {
- await LocalSecureStore.instance.setManualSyncTrigger(false);
- isSyncCompleted = true;
- }
-
- return isSyncCompleted;
- }
-
-
- FutureOr writeToEntityDB(
- Map response,
- List localRepositories,
- ) async {
- try {
- for (int i = 0; i <= response.keys.length - 1; i++) {
- if (response.keys.elementAt(i) != 'DownsyncCriteria') {
- final local = RepositoryType.getLocalForType(
- DataModels.getDataModelForEntityName(response.keys.elementAt(i)),
- localRepositories,
- );
- final List entityResponse =
- response[response.keys.elementAt(i)] ?? [];
-
- final entityList =
- entityResponse.whereType