closeModal method
Function to close the choice modal
Implementation
void closeModal({bool confirmed = true}) {
// pop the navigation
if (confirmed == true)
// will call the onWillPop
Navigator.maybePop(context, true);
else
// no need to call the onWillPop
Navigator.pop(context, false);
}