MediaQueryList class

A object stores information on a media query applied to a document, with support for both immediate and event-driven matching against the state of the document. You can create a by calling matchMedia() on the window object. The resulting object handles sending notifications to listeners when the media query state changes (i.e. when the media query test starts or stops evaluating to true). This is very useful for adaptive design, since this makes it possible to observe a document to detect when its media queries change, instead of polling the values periodically, and allows you to programmatically make changes to a document based on media query status.

EventTarget

MediaQueryList

Implemented types
Available extensions
Annotations
  • @JS()
  • @staticInterop

Constructors

MediaQueryList()
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
matches bool

Available on MediaQueryList, provided by the PropsMediaQueryList extension

no setter
media String

Available on MediaQueryList, provided by the PropsMediaQueryList extension

no setter
onchange EventHandlerNonNull<Event>?

Available on MediaQueryList, provided by the PropsMediaQueryList extension

getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addEventListener(String type, EventListener? callback, [dynamic options]) → void

Available on EventTarget, provided by the PropsEventTarget extension

addListener(EventListener? callback) → void

Available on MediaQueryList, provided by the PropsMediaQueryList extension

dispatchEvent(Event event) bool

Available on EventTarget, provided by the PropsEventTarget extension

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeEventListener(String type, EventListener? callback, [dynamic options]) → void

Available on EventTarget, provided by the PropsEventTarget extension

removeListener(EventListener? callback) → void

Available on MediaQueryList, provided by the PropsMediaQueryList extension

toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited