|
|
|
|
|
|
TextDirection? textDirection = null, |
|
|
|
VerticalDirection verticalDirection = VerticalDirection.down |
|
|
|
) { |
|
|
|
D.assert(direction != null); |
|
|
|
D.assert(alignment != null); |
|
|
|
D.assert(spacing != null); |
|
|
|
D.assert(runAlignment != null); |
|
|
|
D.assert(runSpacing != null); |
|
|
|
D.assert(crossAxisAlignment != null); |
|
|
|
|
|
|
|
this._direction = direction; |
|
|
|
this._alignment = alignment; |
|
|
|
this._spacing = spacing; |
|
|
|
|
|
|
public Axis direction { |
|
|
|
get { return this._direction; } |
|
|
|
set { |
|
|
|
D.assert(value != null); |
|
|
|
if (this._direction == value) { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
public WrapAlignment alignment { |
|
|
|
get { return this._alignment; } |
|
|
|
set { |
|
|
|
D.assert(value != null); |
|
|
|
if (this._alignment == value) { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
public float spacing { |
|
|
|
get { return this._spacing; } |
|
|
|
set { |
|
|
|
D.assert(value != null); |
|
|
|
if (this._spacing == value) { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
public WrapAlignment runAlignment { |
|
|
|
get { return this._runAlignment; } |
|
|
|
set { |
|
|
|
D.assert(value != null); |
|
|
|
if (this._runAlignment == value) { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
public float runSpacing { |
|
|
|
get { return this._runSpacing; } |
|
|
|
set { |
|
|
|
D.assert(value != null); |
|
|
|
if (this._runSpacing == value) { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
public WrapCrossAlignment crossAxisAlignment { |
|
|
|
get { return this._crossAxisAlignment; } |
|
|
|
set { |
|
|
|
D.assert(value != null); |
|
|
|
if (this._crossAxisAlignment == value) { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
public bool _debugHasNecessaryDirections { |
|
|
|
get { |
|
|
|
D.assert(this.direction != null); |
|
|
|
D.assert(this.alignment != null); |
|
|
|
D.assert(this.runAlignment != null); |
|
|
|
D.assert(this.crossAxisAlignment != null); |
|
|
|
if (this.firstChild != null && this.lastChild != this.firstChild) { |
|
|
|
// i.e. there"s more than one child
|
|
|
|
switch (this.direction) { |
|
|
|
|
|
|
break; |
|
|
|
case Axis.vertical: |
|
|
|
D.assert(this.verticalDirection != null, |
|
|
|
"Vertical $runtimeType with multiple children has a null verticalDirection, so the layout order is undefined."); |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
"Horizontal $runtimeType with alignment $alignment has a null textDirection, so the alignment cannot be resolved."); |
|
|
|
break; |
|
|
|
case Axis.vertical: |
|
|
|
D.assert(this.verticalDirection != null, |
|
|
|
"Vertical $runtimeType with alignment $alignment has a null verticalDirection, so the alignment cannot be resolved."); |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
case Axis.horizontal: |
|
|
|
D.assert(this.verticalDirection != null, |
|
|
|
"Horizontal $runtimeType with runAlignment $runAlignment has a null verticalDirection, so the alignment cannot be resolved."); |
|
|
|
break; |
|
|
|
case Axis.vertical: |
|
|
|
D.assert(this.textDirection != null, |
|
|
|
|
|
|
this.crossAxisAlignment == WrapCrossAlignment.end) { |
|
|
|
switch (this.direction) { |
|
|
|
case Axis.horizontal: |
|
|
|
D.assert(this.verticalDirection != null, |
|
|
|
"Horizontal $runtimeType with crossAxisAlignment $crossAxisAlignment has a null verticalDirection, so the alignment cannot be resolved."); |
|
|
|
break; |
|
|
|
case Axis.vertical: |
|
|
|
D.assert(this.textDirection != null, |
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
D.assert(childConstraints != null); |
|
|
|
D.assert(mainAxisLimit != null); |
|
|
|
float spacing = this.spacing; |
|
|
|
float runSpacing = this.runSpacing; |
|
|
|
List<_RunMetrics> runMetrics = new List<_RunMetrics> { }; |
|
|
|