byKeyLocation method

TapTarget byKeyLocation(
  1. Key key
)

Returns a TapTarget centered on the first match for key.

Implementation

TapTarget byKeyLocation(Key key) {
  final match = firstByKey(key);
  if (match == null) {
    throw StateError('No mounted element found for key $key');
  }
  return _ElementTapTarget(match);
}