AxisPosition class final

Where a child of a freeform (stack) parent sits on one axis, as Flutter's Positioned or Align, in the parent's padded box:

  • {"start": d}: d from the start edge;
  • {"end": d}: d from the end edge;
  • {"start": a, "end": b}: stretched between the two;
  • {"align": t}: aligned like Align, -1 (start) to 1 (end), by its laid-out size;
  • {"relative": d}: d from the start at design size, keeping its share of the free space (measured with the design sizes) as the parent resizes. A text that lays out wider than designed stays where it was put, which align wouldn't do.
Annotations
  • @immutable

Constructors

AxisPosition.align(double align)
const
AxisPosition.end(double end)
const
AxisPosition.relative(double relative)
const
AxisPosition.start(double start)
const
AxisPosition.stretch(double start, double end)
const

Properties

align → double?
final
end → double?
final
hashCode → int
The hash code for this object.
no setteroverride
isStretch → bool
no setter
relative → double?
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
start → double?
final

Methods

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

Operators

operator ==(Object other) → bool
The equality operator.
override

Static Methods

fromJson(Object? json) → AxisPosition

Constants

zero → const AxisPosition