close method

void close(
  1. UiCall call
)

Close dialog

Implementation

void close(UiCall call) {
  call.dispose();
  if (state.value.dialogRoutes.isEmpty) return;
  final removeIndex =
      state.value.dialogRoutes.indexWhere((e) => e.call == call);
  final newRoutes = state.value.dialogRoutes..removeAt(removeIndex);
  final newState = UiRouterState(
    pageRoutes: state.value.pageRoutes,
    dialogRoutes: newRoutes,
    tasks: state.value.tasks,
  );
  state.value = newState;
}