pop method
Remove the top surface, or the surface named id if given.
Implementation
ShortcutSurface? pop([String? id]) {
if (_stack.isEmpty) return null;
if (id == null) {
final removed = _stack.removeLast();
removed.reset();
removed.attachSend(null);
_notifyStack();
onPendingChanged?.call();
return removed;
}
final i = _indexOf(id);
if (i < 0) return null;
final removed = _stack.removeAt(i);
removed.reset();
removed.attachSend(null);
_notifyStack();
onPendingChanged?.call();
return removed;
}