diff --git a/.github/workflows/flutter-build-apk.yml b/.github/workflows/flutter-build-apk.yml index a8995a1b0..076e96a60 100644 --- a/.github/workflows/flutter-build-apk.yml +++ b/.github/workflows/flutter-build-apk.yml @@ -58,14 +58,30 @@ jobs: - name: Run APK build script env: BUILD_CONFIG: release # or profile depending on your choice - run: bash ./tools/generate-apk.sh + run: | + bash ./tools/generate-apk.sh + echo "Current working directory: $(pwd)" + echo "Listing all files at the current level:" + ls -l + + # Step 8: Verify APK path and upload artifacts + - name: Check APK existence + run: | + echo "Looking for APK file" + if [ -f apps/health_campaign_field_worker_app/build/app/outputs/apk/release/app-release.apk ]; then + echo "APK found." + else + echo "APK not found in the expected path." + find . -name "app-release.apk" + exit 1 + fi # 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 + path: apps/health_campaign_field_worker_app/build/app/outputs/apk/release/app-release.apk - name: Upload .env as artifact uses: actions/upload-artifact@v3 diff --git a/apps/health_campaign_field_worker_app/android/app/src/main/kotlin/com/digit/hcm/MainActivity.kt b/apps/health_campaign_field_worker_app/android/app/src/main/kotlin/com/digit/hcm/MainActivity.kt index bc533d3ac..917a69650 100644 --- a/apps/health_campaign_field_worker_app/android/app/src/main/kotlin/com/digit/hcm/MainActivity.kt +++ b/apps/health_campaign_field_worker_app/android/app/src/main/kotlin/com/digit/hcm/MainActivity.kt @@ -6,6 +6,7 @@ import android.content.Intent import android.content.IntentFilter import android.os.Build import android.os.Bundle +import android.util.Log import android.widget.Toast import io.flutter.embedding.android.FlutterActivity import io.flutter.plugin.common.MethodChannel @@ -16,7 +17,11 @@ class MainActivity : FlutterActivity() { override fun onReceive(context: Context?, intent: Intent?) { val latitude = intent?.getDoubleExtra("latitude", 0.0) val longitude = intent?.getDoubleExtra("longitude", 0.0) - val accuracy = intent?.getFloatExtra("accuracy", 0.0f) // Retrieve accuracy here + val accuracy = intent?.getFloatExtra("accuracy", 0.0f) ?: 0.0f + if (latitude == null || longitude == null) { + Log.e("LocationReceiver", "Received null location data") + return + } // Handle the location data here Toast.makeText( diff --git a/apps/health_campaign_field_worker_app/lib/data/sync_service_mapper.dart b/apps/health_campaign_field_worker_app/lib/data/sync_service_mapper.dart index 9389bf865..92b9957ee 100644 --- a/apps/health_campaign_field_worker_app/lib/data/sync_service_mapper.dart +++ b/apps/health_campaign_field_worker_app/lib/data/sync_service_mapper.dart @@ -712,6 +712,8 @@ class SyncServiceMapper extends SyncEntityMapperListener { break; + // Note: Uncomment the following code block to enable complaints sync down + // case DataModelType.complaints: // if (remote is! PgrServiceRemoteRepository) return responseEntities; // diff --git a/apps/health_campaign_field_worker_app/lib/pages/authenticated.dart b/apps/health_campaign_field_worker_app/lib/pages/authenticated.dart index c7f98a48f..90efab66c 100644 --- a/apps/health_campaign_field_worker_app/lib/pages/authenticated.dart +++ b/apps/health_campaign_field_worker_app/lib/pages/authenticated.dart @@ -133,14 +133,7 @@ class AuthenticatedPageWrapper extends StatelessWidget { .listen( (event) { if (!bloc.isClosed) { - bloc.add( - SyncRefreshEvent( - userId, - SyncServiceSingleton() - .entityMapper! - .getSyncCount(event), - ), - ); + triggerSyncRefreshEvent(bloc, userId, event); } }, ); @@ -154,14 +147,7 @@ class AuthenticatedPageWrapper extends StatelessWidget { .listen( (event) { if (!bloc.isClosed) { - bloc.add( - SyncRefreshEvent( - userId, - SyncServiceSingleton() - .entityMapper! - .getSyncCount(event), - ), - ); + triggerSyncRefreshEvent(bloc, userId, event); } }, ); @@ -244,4 +230,14 @@ class AuthenticatedPageWrapper extends StatelessWidget { ), ); } + + void triggerSyncRefreshEvent( + SyncBloc bloc, String userId, List event) { + bloc.add( + SyncRefreshEvent( + userId, + SyncServiceSingleton().entityMapper!.getSyncCount(event), + ), + ); + } } diff --git a/apps/health_campaign_field_worker_app/pubspec.lock b/apps/health_campaign_field_worker_app/pubspec.lock index dff3b3736..88ebc49aa 100644 --- a/apps/health_campaign_field_worker_app/pubspec.lock +++ b/apps/health_campaign_field_worker_app/pubspec.lock @@ -444,11 +444,12 @@ packages: dart_mappable_builder: dependency: "direct dev" description: - name: dart_mappable_builder - sha256: "04a6e7117382f8a8689b3e363bee6c3de8c9ea4332e664148fe01bd576eb1126" - url: "https://pub.dev" - source: hosted - version: "4.3.0" + path: "packages/dart_mappable_builder" + ref: master + resolved-ref: ab088b8fc21a07ed7a56bf81c935ee51481ad253 + url: "https://github.com/egovernments/health-campaign-field-worker-app/" + source: git + version: "4.2.3" dart_style: dependency: transitive description: diff --git a/apps/health_campaign_field_worker_app/pubspec.yaml b/apps/health_campaign_field_worker_app/pubspec.yaml index c85e790ba..35e6eb202 100644 --- a/apps/health_campaign_field_worker_app/pubspec.yaml +++ b/apps/health_campaign_field_worker_app/pubspec.yaml @@ -85,7 +85,11 @@ dev_dependencies: auto_route_generator: ^8.0.0 bloc_test: ^9.1.0 mocktail: ^1.0.2 - dart_mappable_builder: ^4.2.2 + dart_mappable_builder: + git: + url: https://github.com/egovernments/health-campaign-field-worker-app/ + ref: master + path: ./packages/dart_mappable_builder isar_generator: ^3.1.0+1 flutter_launcher_icons: ^0.13.1 hrk_flutter_test_batteries: ^0.8.0 diff --git a/packages/attendance_management/pubspec.lock b/packages/attendance_management/pubspec.lock index 1ac5cfd25..8091eeedf 100644 --- a/packages/attendance_management/pubspec.lock +++ b/packages/attendance_management/pubspec.lock @@ -309,8 +309,8 @@ packages: dependency: "direct dev" description: path: "packages/dart_mappable_builder" - ref: "1.6-final-dev" - resolved-ref: "1e7467577a9701d396f7e23afbf00065e54c5469" + ref: master + resolved-ref: ab088b8fc21a07ed7a56bf81c935ee51481ad253 url: "https://github.com/egovernments/health-campaign-field-worker-app/" source: git version: "4.2.3" diff --git a/packages/attendance_management/pubspec.yaml b/packages/attendance_management/pubspec.yaml index be9f0307b..cdcc5d7dc 100644 --- a/packages/attendance_management/pubspec.yaml +++ b/packages/attendance_management/pubspec.yaml @@ -43,7 +43,7 @@ dev_dependencies: dart_mappable_builder: git: url: https://github.com/egovernments/health-campaign-field-worker-app/ - ref: 1.6-final-dev + ref: master path: ./packages/dart_mappable_builder drift_dev: ^2.18.0 build_runner: ^2.4.11 diff --git a/packages/closed_household/pubspec.lock b/packages/closed_household/pubspec.lock index 704277232..6be4e1220 100644 --- a/packages/closed_household/pubspec.lock +++ b/packages/closed_household/pubspec.lock @@ -373,8 +373,8 @@ packages: dependency: "direct dev" description: path: "packages/dart_mappable_builder" - ref: "1.6-final-dev" - resolved-ref: "1e7467577a9701d396f7e23afbf00065e54c5469" + ref: master + resolved-ref: ab088b8fc21a07ed7a56bf81c935ee51481ad253 url: "https://github.com/egovernments/health-campaign-field-worker-app/" source: git version: "4.2.3" diff --git a/packages/closed_household/pubspec.yaml b/packages/closed_household/pubspec.yaml index 27394bd01..951ebeba3 100644 --- a/packages/closed_household/pubspec.yaml +++ b/packages/closed_household/pubspec.yaml @@ -55,7 +55,7 @@ dev_dependencies: dart_mappable_builder: git: url: https://github.com/egovernments/health-campaign-field-worker-app/ - ref: 1.6-final-dev + ref: master path: ./packages/dart_mappable_builder auto_route_generator: ^8.0.0 build_runner: ^2.4.11 diff --git a/packages/complaints/pubspec.lock b/packages/complaints/pubspec.lock index 20435b65a..8643b1d09 100644 --- a/packages/complaints/pubspec.lock +++ b/packages/complaints/pubspec.lock @@ -293,8 +293,8 @@ packages: dependency: "direct dev" description: path: "packages/dart_mappable_builder" - ref: "1.6-final-dev" - resolved-ref: "1e7467577a9701d396f7e23afbf00065e54c5469" + ref: master + resolved-ref: ab088b8fc21a07ed7a56bf81c935ee51481ad253 url: "https://github.com/egovernments/health-campaign-field-worker-app/" source: git version: "4.2.3" diff --git a/packages/complaints/pubspec.yaml b/packages/complaints/pubspec.yaml index 462456135..2f3c722a2 100644 --- a/packages/complaints/pubspec.yaml +++ b/packages/complaints/pubspec.yaml @@ -41,7 +41,7 @@ dev_dependencies: dart_mappable_builder: git: url: https://github.com/egovernments/health-campaign-field-worker-app/ - ref: 1.6-final-dev + ref: master path: ./packages/dart_mappable_builder bloc_test: ^9.1.0 mocktail: ^1.0.2 diff --git a/packages/digit_data_model/pubspec.lock b/packages/digit_data_model/pubspec.lock index 52da34c0e..022798c26 100644 --- a/packages/digit_data_model/pubspec.lock +++ b/packages/digit_data_model/pubspec.lock @@ -229,8 +229,8 @@ packages: dependency: "direct dev" description: path: "packages/dart_mappable_builder" - ref: "1.6-final-dev" - resolved-ref: "1e7467577a9701d396f7e23afbf00065e54c5469" + ref: master + resolved-ref: ab088b8fc21a07ed7a56bf81c935ee51481ad253 url: "https://github.com/egovernments/health-campaign-field-worker-app/" source: git version: "4.2.3" diff --git a/packages/digit_data_model/pubspec.yaml b/packages/digit_data_model/pubspec.yaml index 5298d5f6a..14b3a3743 100644 --- a/packages/digit_data_model/pubspec.yaml +++ b/packages/digit_data_model/pubspec.yaml @@ -38,7 +38,7 @@ dev_dependencies: dart_mappable_builder: git: url: https://github.com/egovernments/health-campaign-field-worker-app/ - ref: 1.6-final-dev + ref: master path: ./packages/dart_mappable_builder isar_generator: ^3.0.5 diff --git a/packages/digit_dss/pubspec.lock b/packages/digit_dss/pubspec.lock index 70d370a71..82ead67eb 100644 --- a/packages/digit_dss/pubspec.lock +++ b/packages/digit_dss/pubspec.lock @@ -365,7 +365,7 @@ packages: path: "../digit_data_model" relative: true source: path - version: "1.0.5" + version: "1.0.5+1" digit_firebase_services: dependency: "direct overridden" description: diff --git a/packages/digit_dss/pubspec.yaml b/packages/digit_dss/pubspec.yaml index 8b0865af8..e7f72853a 100644 --- a/packages/digit_dss/pubspec.yaml +++ b/packages/digit_dss/pubspec.yaml @@ -41,7 +41,7 @@ dev_dependencies: dart_mappable_builder: git: url: https://github.com/egovernments/health-campaign-field-worker-app/ - ref: 1.6-final-dev + ref: master path: ./packages/dart_mappable_builder auto_route_generator: ^8.0.0 isar_generator: ^3.1.0+1 diff --git a/packages/inventory_management/pubspec.lock b/packages/inventory_management/pubspec.lock index db72d69b2..01cbeef67 100644 --- a/packages/inventory_management/pubspec.lock +++ b/packages/inventory_management/pubspec.lock @@ -372,10 +372,11 @@ packages: dart_mappable_builder: dependency: "direct dev" description: - name: dart_mappable_builder - sha256: ab5cf9086862d3fceb9773e945b5f95cc5471a28c782a4fc451bd400a4e0c64e - url: "https://pub.dev" - source: hosted + path: "packages/dart_mappable_builder" + ref: master + resolved-ref: ab088b8fc21a07ed7a56bf81c935ee51481ad253 + url: "https://github.com/egovernments/health-campaign-field-worker-app/" + source: git version: "4.2.3" dart_style: dependency: transitive @@ -412,10 +413,9 @@ packages: digit_scanner: dependency: "direct main" description: - name: digit_scanner - sha256: c33af61ed9ab3d7740fc3c8948af4b763d946cba5e902f8bfb00948d4d69d60a - url: "https://pub.dev" - source: hosted + path: "../digit_scanner" + relative: true + source: path version: "1.0.4" digit_ui_components: dependency: "direct main" @@ -1627,5 +1627,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.4.0 <3.9.0" + dart: ">=3.4.0 <4.0.0" flutter: ">=3.22.0" diff --git a/packages/inventory_management/pubspec.yaml b/packages/inventory_management/pubspec.yaml index 344ede57b..e9d619e55 100644 --- a/packages/inventory_management/pubspec.yaml +++ b/packages/inventory_management/pubspec.yaml @@ -46,7 +46,11 @@ dev_dependencies: bloc_test: ^9.1.0 build_runner: ^2.4.11 mocktail: ^1.0.2 - dart_mappable_builder: ^4.2.2 + dart_mappable_builder: + git: + url: https://github.com/egovernments/health-campaign-field-worker-app/ + ref: master + path: ./packages/dart_mappable_builder auto_route_generator: ^8.0.0 flutter: diff --git a/packages/referral_reconciliation/pubspec.lock b/packages/referral_reconciliation/pubspec.lock index ed63fd65a..7aa3b9bf2 100644 --- a/packages/referral_reconciliation/pubspec.lock +++ b/packages/referral_reconciliation/pubspec.lock @@ -373,8 +373,8 @@ packages: dependency: "direct dev" description: path: "packages/dart_mappable_builder" - ref: "1.6-final-dev" - resolved-ref: "1e7467577a9701d396f7e23afbf00065e54c5469" + ref: master + resolved-ref: ab088b8fc21a07ed7a56bf81c935ee51481ad253 url: "https://github.com/egovernments/health-campaign-field-worker-app/" source: git version: "4.2.3" @@ -405,10 +405,9 @@ packages: digit_scanner: dependency: "direct main" description: - name: digit_scanner - sha256: c33af61ed9ab3d7740fc3c8948af4b763d946cba5e902f8bfb00948d4d69d60a - url: "https://pub.dev" - source: hosted + path: "../digit_scanner" + relative: true + source: path version: "1.0.4" digit_ui_components: dependency: "direct main" @@ -1406,10 +1405,9 @@ packages: survey_form: dependency: "direct main" description: - name: survey_form - sha256: "5e3a08570fe8c97d7dfd0bc6f28b2ae829e2fe66ce987504920c20d091c47c19" - url: "https://pub.dev" - source: hosted + path: "../survey_form" + relative: true + source: path version: "1.0.0" synchronized: dependency: transitive diff --git a/packages/referral_reconciliation/pubspec.yaml b/packages/referral_reconciliation/pubspec.yaml index 0a1746511..16b417a0e 100644 --- a/packages/referral_reconciliation/pubspec.yaml +++ b/packages/referral_reconciliation/pubspec.yaml @@ -52,7 +52,7 @@ dev_dependencies: dart_mappable_builder: git: url: https://github.com/egovernments/health-campaign-field-worker-app/ - ref: 1.6-final-dev + ref: master path: ./packages/dart_mappable_builder auto_route_generator: ^8.0.0 diff --git a/packages/registration_delivery/pubspec.lock b/packages/registration_delivery/pubspec.lock index e027ca226..445b4965b 100644 --- a/packages/registration_delivery/pubspec.lock +++ b/packages/registration_delivery/pubspec.lock @@ -373,8 +373,8 @@ packages: dependency: "direct dev" description: path: "packages/dart_mappable_builder" - ref: "1.6-final-dev" - resolved-ref: "1e7467577a9701d396f7e23afbf00065e54c5469" + ref: master + resolved-ref: ab088b8fc21a07ed7a56bf81c935ee51481ad253 url: "https://github.com/egovernments/health-campaign-field-worker-app/" source: git version: "4.2.3" @@ -413,10 +413,9 @@ packages: digit_scanner: dependency: "direct main" description: - name: digit_scanner - sha256: c33af61ed9ab3d7740fc3c8948af4b763d946cba5e902f8bfb00948d4d69d60a - url: "https://pub.dev" - source: hosted + path: "../digit_scanner" + relative: true + source: path version: "1.0.4" digit_showcase: dependency: "direct main" @@ -1462,10 +1461,9 @@ packages: survey_form: dependency: "direct main" description: - name: survey_form - sha256: "5e3a08570fe8c97d7dfd0bc6f28b2ae829e2fe66ce987504920c20d091c47c19" - url: "https://pub.dev" - source: hosted + path: "../survey_form" + relative: true + source: path version: "1.0.0" synchronized: dependency: transitive @@ -1732,5 +1730,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.4.0 <3.9.0" + dart: ">=3.4.0 <4.0.0" flutter: ">=3.22.0" diff --git a/packages/registration_delivery/pubspec.yaml b/packages/registration_delivery/pubspec.yaml index e69849bfa..887564178 100644 --- a/packages/registration_delivery/pubspec.yaml +++ b/packages/registration_delivery/pubspec.yaml @@ -56,7 +56,7 @@ dev_dependencies: dart_mappable_builder: git: url: https://github.com/egovernments/health-campaign-field-worker-app/ - ref: 1.6-final-dev + ref: master path: ./packages/dart_mappable_builder auto_route_generator: ^8.0.0 diff --git a/packages/survey_form/pubspec.lock b/packages/survey_form/pubspec.lock index 076ded7c8..87c091d6a 100644 --- a/packages/survey_form/pubspec.lock +++ b/packages/survey_form/pubspec.lock @@ -309,8 +309,8 @@ packages: dependency: "direct dev" description: path: "packages/dart_mappable_builder" - ref: "1.6-final-dev" - resolved-ref: "1e7467577a9701d396f7e23afbf00065e54c5469" + ref: master + resolved-ref: ab088b8fc21a07ed7a56bf81c935ee51481ad253 url: "https://github.com/egovernments/health-campaign-field-worker-app/" source: git version: "4.2.3" diff --git a/packages/survey_form/pubspec.yaml b/packages/survey_form/pubspec.yaml index 8b5705529..6e11732d5 100644 --- a/packages/survey_form/pubspec.yaml +++ b/packages/survey_form/pubspec.yaml @@ -39,7 +39,7 @@ dev_dependencies: dart_mappable_builder: git: url: https://github.com/egovernments/health-campaign-field-worker-app/ - ref: 1.6-final-dev + ref: master path: ./packages/dart_mappable_builder drift_dev: ^2.14.1 auto_route_generator: ^8.0.0 diff --git a/packages/sync_service/pubspec.yaml b/packages/sync_service/pubspec.yaml index 418269925..1d8c2af7f 100644 --- a/packages/sync_service/pubspec.yaml +++ b/packages/sync_service/pubspec.yaml @@ -42,7 +42,7 @@ dev_dependencies: dart_mappable_builder: git: url: https://github.com/egovernments/health-campaign-field-worker-app/ - ref: 1.6-final-dev + ref: master path: ./packages/dart_mappable_builder # For information on the generic Dart part of this file, see the diff --git a/tools/generate-apk.sh b/tools/generate-apk.sh index 163380112..4d578fa4c 100755 --- a/tools/generate-apk.sh +++ b/tools/generate-apk.sh @@ -24,8 +24,6 @@ echo "Please select a build config (release or profile):" read build_config build_config="${build_config:-release}" -cd "$APP_DIR" || exit - # # Build APK for specified environment(s) and build config # if [ "$env" == "ALL" ]; then # env_list=("UAT" "DEV" "QA") @@ -33,7 +31,9 @@ cd "$APP_DIR" || exit # env_list=("$env") # fi -# ./tools/install_bricks.sh +./tools/install_bricks.sh + +cd "$APP_DIR" || exit # for env_option in "${env_list[@]}"; do # cd "$APP_DIR" || exit @@ -53,8 +53,8 @@ cd "$APP_DIR" || exit build_apk cd ../../ || exit - mkdir -p outputs - mv "$APP_DIR/build/app/outputs/flutter-apk/app-$build_config.apk" "outputs/app-$env_option-$build_config.apk" + # mkdir -p outputs + # mv "$APP_DIR/build/app/outputs/apk/release/app-$build_config.apk" "outputs/app-$env_option-$build_config.apk" # done # open outputs