openCloseRoomDialog function

Future<bool> openCloseRoomDialog({
  1. required dynamic context,
  2. required String roomId,
  3. dynamic cancelBtnKey,
  4. dynamic confirmBtnKey,
})

Implementation

Future<bool> openCloseRoomDialog({
  required BuildContext context,
  required final String roomId,
  final Key? cancelBtnKey,
  final Key? confirmBtnKey,
}) async {
  final removedRoom = await showAdaptiveDialog(
    context: context,
    useRootNavigator: false,
    builder: (context) => _CloseRoomConfirmation(
      roomId: roomId,
      cancelBtnKey: cancelBtnKey,
      confirmBtnKey: confirmBtnKey,
    ),
  );
  if (removedRoom && context.mounted) {
    // redirect the user after the process is done
    context.goNamed(Routes.main.name);
  }
  return removedRoom;
}