DomResult typedef

DomResult = ({bool available, bool Function(String id, {bool preventScroll}) focusById, void Function() lockBodyScroll, bool Function(String selector, {String block, String inline, bool smooth}) scrollIntoView, DomPoint Function() scrollPosition, bool Function(String id, {double offset, bool smooth}) scrollToId, bool Function({double? left, bool smooth, double? top}) scrollToPosition, bool Function({bool smooth}) scrollToTop, void Function() unlockBodyScroll, DomViewport Function() viewport})

Result record for useDom.

Implementation

typedef DomResult = ({
  /// Whether browser DOM APIs are currently available.
  bool available,

  /// Scroll to the top-left corner of the page.
  bool Function({bool smooth}) scrollToTop,

  /// Scroll window to an absolute position.
  bool Function({double? top, double? left, bool smooth}) scrollToPosition,

  /// Scroll to an element ID. Optional [offset] is useful for sticky headers.
  bool Function(String id, {bool smooth, double offset}) scrollToId,

  /// Scroll first matching selector into view.
  bool Function(String selector, {bool smooth, String block, String inline}) scrollIntoView,

  /// Focus an element by ID.
  bool Function(String id, {bool preventScroll}) focusById,

  /// Current window scroll position.
  DomPoint Function() scrollPosition,

  /// Current viewport size.
  DomViewport Function() viewport,

  /// Lock body scrolling.
  void Function() lockBodyScroll,

  /// Unlock body scrolling.
  void Function() unlockBodyScroll,
});