Position class abstract

The position CSS property sets how an element is positioned in a document

See also:

  • ZIndex for controlling the stack order of positioned elements.

Read more: MDN position

Constructors

Position.absolute({Unit? top, Unit? left, Unit? bottom, Unit? right})
The element is removed from the normal document flow, and no space is created for the element in the page layout. The element is positioned relative to its closest positioned ancestor (if any) or to the initial containing block. Its final position is determined by the values of top, right, bottom, and left.
const
factory
Position.fixed({Unit? top, Unit? left, Unit? bottom, Unit? right})
The element is removed from the normal document flow, and no space is created for the element in the page layout. The element is positioned relative to its initial containing block, which is the viewport in the case of visual media. Its final position is determined by the values of top, right, bottom, and left.
const
factory
Position.relative({Unit? top, Unit? left, Unit? bottom, Unit? right})
The element is positioned according to the normal flow of the document, and then offset relative to itself based on the values of top, right, bottom, and left. The offset does not affect the position of any other elements; thus, the space given for the element in the page layout is the same as if position were static.
const
factory
Position.sticky({Unit? top, Unit? left, Unit? bottom, Unit? right})
The element is positioned according to the normal flow of the document, and then offset relative to its nearest scrolling ancestor and containing block (nearest block-level ancestor), including table-related elements, based on the values of top, right, bottom, and left. The offset does not affect the position of any other elements.
const
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
styles Map<String, String>
The css styles
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Constants

inherit → const Position
initial → const Position
revert → const Position
revertLayer → const Position
static → const Position
The element is positioned according to the Normal Flow of the document. This is the default value.
unset → const Position