of static method

MorphFlight of(
  1. BuildContext context
)

The enclosing flight; asserts outside flight content.

Implementation

static MorphFlight of(BuildContext context) {
  final MorphFlightScope? scope = context
      .getInheritedWidgetOfExactType<MorphFlightScope>();
  assert(
    scope != null,
    'No MorphFlightScope found: MorphReveal and other flight consumers '
    'only work inside the content of a morph overlay.',
  );
  return scope!.flight;
}