last static method
A selector that returns the last overlay that matches the given id.
If id is null, it returns the last overlay.
This is the default selector for context.close().
Example:
context.close(Overlays.last(id: 'my-id'));
Implementation
static OverlayCloser? Function(Iterable<OverlayCloser> closers) last({
String? id,
}) {
return (Iterable<OverlayCloser> closers) {
final filtered = id != null ? closers.byId(id) : closers;
return filtered.isEmpty ? null : filtered.last;
};
}