canPopUntilPopUp method
bool
canPopUntilPopUp(
{
})
Implementation
bool canPopUntilPopUp({required String popUpName}) {
if (openedDialogOrBottomSheetList.isEmpty) return false;
//use sublist to skip checking the last one. it pops anyway even if it is equal to the input
bool nameIsInDialogsOrBottomSheets = openedDialogOrBottomSheetList
.sublist(0, openedDialogOrBottomSheetList.length - 1)
.any((element) => _getPopUpNameFromRegisteredString(popUpNameAndKey: element) == popUpName);
return nameIsInDialogsOrBottomSheets;
}