RouterLink constructor

RouterLink(
  1. Router _router,
  2. Location _location,
  3. @Attribute.new('target') String? _target,
  4. Element element,
)

Implementation

RouterLink(
  this._router,
  this._location,
  @Attribute('target') this._target,
  Element element,
) {
  // The browser will synthesize a click event for anchor elements when they
  // receive an Enter key press. For other elements, we must manually add a
  // key press listener to ensure the link remains keyboard accessible.
  if (element is! AnchorElement) {
    _keyPressSubscription = element.onKeyPress.listen(_onKeyPress);
  }
}