idOf static method

Object idOf(
  1. BuildContext context
)

The id of the nearest enclosing MorphTag. Lets a tap handler inside the tag's own subtree call showMorph* WITHOUT repeating the id - the morph flies from the surface the finger is already on. Content that launches a morph from elsewhere (a morphable skin piece, a list controller) still names its source explicitly.

Implementation

static Object idOf(BuildContext context) {
  final Object? id = maybeIdOf(context);
  assert(
    id != null,
    'No enclosing MorphTag: pass from: explicitly, or call from within '
    'the source tag\'s subtree.',
  );
  return id!;
}