alignment property Null safety

AlignmentGeometry alignment

How to align the child.

The x and y values of the alignment control the horizontal and vertical alignment, respectively. An x value of -1.0 means that the left edge of the child is aligned with the left edge of the parent whereas an x value of 1.0 means that the right edge of the child is aligned with the right edge of the parent. Other values interpolate (and extrapolate) linearly. For example, a value of 0.0 means that the center of the child is aligned with the center of the parent.

If this is set to an AlignmentDirectional object, then textDirection must not be null.

Implementation

AlignmentGeometry get alignment => _alignment;
void alignment=(AlignmentGeometry value)

Sets the alignment to a new value, and triggers a layout update.

The new alignment must not be null.

Implementation

set alignment(AlignmentGeometry value) {
  assert(value != null);
  if (_alignment == value) {
    return;
  }
  _alignment = value;
  _markNeedResolution();
}