showMorph function

MorphFlight showMorph(
  1. BuildContext context, {
  2. Object? from,
  3. required MorphTargetSpec target,
  4. required MorphContentBuilder builder,
  5. MorphMotion? motion,
  6. bool barrierDismissible = true,
  7. double? maxScrimOpacity,
  8. Color? scrimColor,
  9. Color? shadowColor,
  10. VoidCallback? onDismissRequested,
  11. String? semanticLabel,
})

The public entry point: all the plumbing (Ticker, listener, Overlay, ghost, and the handoff latch) is under the hood. If a flight for the tag already exists, the call retargets it instead of creating a new one (RETARGET CONTRACT: the existing flight keeps its target, builder, barrier and scrim; only motion, dismissal routing and the semantic label are updated).

from may be omitted when the call happens INSIDE the source tag's own subtree (an onTap on the surface itself): the nearest enclosing MorphTag is the source. Calls from elsewhere name it explicitly.

Ambient defaults resolve as explicit parameter > MorphTheme > built-in.

Implementation

MorphFlight showMorph(
  BuildContext context, {
  Object? from,
  required MorphTargetSpec target,
  required MorphContentBuilder builder,
  MorphMotion? motion,
  bool barrierDismissible = true,
  double? maxScrimOpacity,
  Color? scrimColor,
  Color? shadowColor,
  VoidCallback? onDismissRequested,
  String? semanticLabel,
}) {
  final MorphTheme? theme = MorphTheme.maybeOf(context);
  return .launch(
    context,
    from: from ?? MorphTag.idOf(context),
    target: target,
    builder: builder,
    motion: motion ?? theme?.motion,
    barrierDismissible: barrierDismissible,
    maxScrimOpacity: maxScrimOpacity ?? theme?.maxScrimOpacity ?? 0.45,
    scrimColor: scrimColor ?? theme?.scrimColor ?? Colors.black,
    shadowColor: shadowColor ?? theme?.shadowColor ?? const Color(0x99000000),
    onDismissRequested: onDismissRequested,
    semanticLabel: semanticLabel,
  );
}