Skip to content

Commit

Permalink
Did you find the waste at the given Location
Browse files Browse the repository at this point in the history
  • Loading branch information
thekaailashsharma committed Nov 26, 2023
1 parent 3097fc9 commit 9561310
Showing 1 changed file with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ fun CollectWasteInfo(
) {
val context = LocalContext.current
var isDialogVisible by remember { mutableStateOf(false) }
var isDialogMainVisible by remember { mutableStateOf(false) }
val isWithin = isWithinRadius(
viewModel.latitude,
viewModel.longitude,
Expand Down Expand Up @@ -187,8 +188,7 @@ fun CollectWasteInfo(
if (!isWithin) {
isDialogVisible = true
} else {
viewModel.beforeCollectedPath.value = viewModel.wastePhoto.value
navController.navigate(Screens.CollectedWasteSuccess.route)
isDialogMainVisible = true
}
},
colors = ButtonDefaults.buttonColors(
Expand Down Expand Up @@ -224,6 +224,21 @@ fun CollectWasteInfo(
}
)
}

DialogBox(
isVisible = isDialogMainVisible,
title = "Did you find the waste at the given location?",
description = "",
successRequest = {
isDialogVisible = false
viewModel.beforeCollectedPath.value = viewModel.wastePhoto.value
navController.navigate(Screens.CollectedWasteSuccess.route)
},
dismissRequest = {
isDialogMainVisible = false
}
)

}

}
Expand Down

0 comments on commit 9561310

Please sign in to comment.