holdForSheet method

void holdForSheet(
  1. ModalRoute route,
  2. GlassBarSheetItem item,
  3. GlassMorphAnchor anchor
)

Keeps item's capsule hoisted through the sheet about to be presented out of anchor.

Called by the pinned host on the tap, before the item presents, so the hold is in place by the frame the sheet's route lands and the group is never unmounted from under the droplet. The hold is inert until a route is presented over route — the chrome stays hoisted exactly as it was — so the presenter may take as long as it needs to get there: measuring the sheet's content offscreen, awaiting a fetch. A tap that presents nothing leaves a hold that the next tap, presentation or unregistration of the route replaces. One whose presentation arrives with the anchor unemptied — a dialog, a sheet shown without the morph — is dropped at the end of that presentation's first frame, and the chrome hands back as for any other presentation. So is one whose presentation has gone.

Implementation

void holdForSheet(
  ModalRoute<dynamic> route,
  GlassBarSheetItem item,
  GlassMorphAnchor anchor,
) {
  _dropSheetHold();
  _sheetHold = _SheetHold(route: route, item: item, anchor: anchor);
  anchor.presentationChanges.addListener(_onSheetPresentationChanged);
}