onClose property

void Function(String reason)? onClose
final

Fires on close with why: user/back for the close button and back, screen_exit for an OS kill, skin for the skin's own close, cta for a handoff op, cancelled for a coordination cancel, superseded for a live-test replace, http_timeout for a shown hang, failure for a post-show failure. A close before the first ready never fires this: it fails as closed_before_ready (or the pre-show reason) instead.

Implementation

final void Function(String reason)? onClose;