handleLocationState method

void handleLocationState(
  1. LocationState locationState,
  2. BuildContext context,
  3. DeliverInterventionState deliverInterventionState,
  4. FormGroup form,
  5. HouseholdMemberWrapper householdMember,
  6. ProjectBeneficiaryModel projectBeneficiary,
)

Implementation

void handleLocationState(
    LocationState locationState,
    BuildContext context,
    DeliverInterventionState deliverInterventionState,
    FormGroup form,
    HouseholdMemberWrapper householdMember,
    ProjectBeneficiaryModel projectBeneficiary) {
  if (context.mounted) {
    DigitComponentsUtils().showLocationCapturingDialog(
        context,
        localizations.translate(i18.common.locationCapturing),
        DigitSyncDialogType.inProgress);

    Future.delayed(const Duration(seconds: 2), () {
      // After delay, hide the initial dialog
      DigitComponentsUtils().hideDialog(context);
      handleCapturedLocationState(
          locationState,
          context,
          deliverInterventionState,
          form,
          householdMember,
          projectBeneficiary);
    });
  }
}