element property

HTMLElement get element

Gets the underlying DOM element.

Throws StateError if accessed before hydration or on server.

Implementation

web.HTMLElement get element {
  if (_element == null) {
    throw StateError(
      'Element not available. Are you running on the server or before hydration?',
    );
  }
  return _element!;
}