pop<T> method

  1. @nonVirtual
void pop<T>([
  1. T? value
])
inherited

Completes the associated Future with the provided value.

Parameters:

  • value - Optional value to return to the caller

Throws:

  • ModuleException if the module is disposed

Implementation

@nonVirtual
void pop<T>([T? value]) {
  if (_stack.isEmpty) return;
  final c = _stack.removeLast().completer;
  logger.info('$name POP ${_stack.length}', ['router']);
  events.emit<String>(['router', 'pop'].join(Events.sep), '');
  c.complete(value);
}