Commit 4f729984 authored by Collin Jackson's avatar Collin Jackson

MultiChildRenderObjectWrapper should take an Iterable instead of a List

parent 2e0d5f92
...@@ -126,7 +126,7 @@ class RenderAutoLayout extends RenderBox ...@@ -126,7 +126,7 @@ class RenderAutoLayout extends RenderBox
RenderBoxContainerDefaultsMixin<RenderBox, AutoLayoutParentData>, RenderBoxContainerDefaultsMixin<RenderBox, AutoLayoutParentData>,
_AutoLayoutParamMixin { _AutoLayoutParamMixin {
RenderAutoLayout({ List<RenderBox> children }) { RenderAutoLayout({ Iterable<RenderBox> children }) {
_setupLayoutParameters(this); _setupLayoutParameters(this);
_setupEditVariablesInSolver(_solver, al.Priority.required - 1); _setupEditVariablesInSolver(_solver, al.Priority.required - 1);
addAll(children); addAll(children);
......
...@@ -35,7 +35,7 @@ abstract class RenderBlockBase extends RenderBox with ContainerRenderObjectMixin ...@@ -35,7 +35,7 @@ abstract class RenderBlockBase extends RenderBox with ContainerRenderObjectMixin
RenderBoxContainerDefaultsMixin<RenderBox, BlockParentData> { RenderBoxContainerDefaultsMixin<RenderBox, BlockParentData> {
RenderBlockBase({ RenderBlockBase({
List<RenderBox> children, Iterable<RenderBox> children,
BlockDirection direction: BlockDirection.vertical, BlockDirection direction: BlockDirection.vertical,
double itemExtent, double itemExtent,
double minExtent: 0.0 double minExtent: 0.0
...@@ -123,7 +123,7 @@ abstract class RenderBlockBase extends RenderBox with ContainerRenderObjectMixin ...@@ -123,7 +123,7 @@ abstract class RenderBlockBase extends RenderBox with ContainerRenderObjectMixin
class RenderBlock extends RenderBlockBase { class RenderBlock extends RenderBlockBase {
RenderBlock({ RenderBlock({
List<RenderBox> children, Iterable<RenderBox> children,
BlockDirection direction: BlockDirection.vertical, BlockDirection direction: BlockDirection.vertical,
double itemExtent, double itemExtent,
double minExtent: 0.0 double minExtent: 0.0
...@@ -231,7 +231,7 @@ class RenderBlockViewport extends RenderBlockBase { ...@@ -231,7 +231,7 @@ class RenderBlockViewport extends RenderBlockBase {
double itemExtent, double itemExtent,
double minExtent: 0.0, double minExtent: 0.0,
double startOffset: 0.0, double startOffset: 0.0,
List<RenderBox> children Iterable<RenderBox> children
}) : _callback = callback, }) : _callback = callback,
_totalExtentCallback = totalExtentCallback, _totalExtentCallback = totalExtentCallback,
_maxCrossAxisExtentCallback = maxCrossAxisDimensionCallback, _maxCrossAxisExtentCallback = maxCrossAxisDimensionCallback,
......
...@@ -85,7 +85,7 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl ...@@ -85,7 +85,7 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
RenderBoxContainerDefaultsMixin<RenderBox, FlexParentData> { RenderBoxContainerDefaultsMixin<RenderBox, FlexParentData> {
RenderFlex({ RenderFlex({
List<RenderBox> children, Iterable<RenderBox> children,
FlexDirection direction: FlexDirection.horizontal, FlexDirection direction: FlexDirection.horizontal,
FlexJustifyContent justifyContent: FlexJustifyContent.start, FlexJustifyContent justifyContent: FlexJustifyContent.start,
FlexAlignItems alignItems: FlexAlignItems.center, FlexAlignItems alignItems: FlexAlignItems.center,
......
...@@ -45,7 +45,7 @@ class GridMetrics { ...@@ -45,7 +45,7 @@ class GridMetrics {
class RenderGrid extends RenderBox with ContainerRenderObjectMixin<RenderBox, GridParentData>, class RenderGrid extends RenderBox with ContainerRenderObjectMixin<RenderBox, GridParentData>,
RenderBoxContainerDefaultsMixin<RenderBox, GridParentData> { RenderBoxContainerDefaultsMixin<RenderBox, GridParentData> {
RenderGrid({ List<RenderBox> children, double maxChildExtent }) { RenderGrid({ Iterable<RenderBox> children, double maxChildExtent }) {
addAll(children); addAll(children);
_maxChildExtent = maxChildExtent; _maxChildExtent = maxChildExtent;
} }
......
...@@ -1230,7 +1230,7 @@ abstract class ContainerRenderObjectMixin<ChildType extends RenderObject, Parent ...@@ -1230,7 +1230,7 @@ abstract class ContainerRenderObjectMixin<ChildType extends RenderObject, Parent
} }
/// Add all the children to the end of this render object's child list /// Add all the children to the end of this render object's child list
void addAll(List<ChildType> children) { void addAll(Iterable<ChildType> children) {
if (children != null) if (children != null)
for (ChildType child in children) for (ChildType child in children)
add(child); add(child);
......
...@@ -33,7 +33,7 @@ class StackParentData extends BoxParentData with ContainerParentDataMixin<Render ...@@ -33,7 +33,7 @@ class StackParentData extends BoxParentData with ContainerParentDataMixin<Render
class RenderStack extends RenderBox with ContainerRenderObjectMixin<RenderBox, StackParentData>, class RenderStack extends RenderBox with ContainerRenderObjectMixin<RenderBox, StackParentData>,
RenderBoxContainerDefaultsMixin<RenderBox, StackParentData> { RenderBoxContainerDefaultsMixin<RenderBox, StackParentData> {
RenderStack({ RenderStack({
List<RenderBox> children Iterable<RenderBox> children
}) { }) {
addAll(children); addAll(children);
} }
......
...@@ -473,7 +473,7 @@ class Container extends Component { ...@@ -473,7 +473,7 @@ class Container extends Component {
// LAYOUT NODES // LAYOUT NODES
class BlockBody extends MultiChildRenderObjectWrapper { class BlockBody extends MultiChildRenderObjectWrapper {
BlockBody(List<Widget> children, { BlockBody(Iterable<Widget> children, {
Key key, Key key,
this.direction: BlockDirection.vertical this.direction: BlockDirection.vertical
}) : super(key: key, children: children) { }) : super(key: key, children: children) {
...@@ -492,7 +492,7 @@ class BlockBody extends MultiChildRenderObjectWrapper { ...@@ -492,7 +492,7 @@ class BlockBody extends MultiChildRenderObjectWrapper {
} }
class Stack extends MultiChildRenderObjectWrapper { class Stack extends MultiChildRenderObjectWrapper {
Stack(List<Widget> children, { Key key }) Stack(Iterable<Widget> children, { Key key })
: super(key: key, children: children); : super(key: key, children: children);
RenderStack createNode() => new RenderStack(); RenderStack createNode() => new RenderStack();
...@@ -555,7 +555,7 @@ class Positioned extends ParentDataNode { ...@@ -555,7 +555,7 @@ class Positioned extends ParentDataNode {
} }
class Grid extends MultiChildRenderObjectWrapper { class Grid extends MultiChildRenderObjectWrapper {
Grid(List<Widget> children, { Key key, this.maxChildExtent }) Grid(Iterable<Widget> children, { Key key, this.maxChildExtent })
: super(key: key, children: children) { : super(key: key, children: children) {
assert(maxChildExtent != null); assert(maxChildExtent != null);
} }
...@@ -572,7 +572,7 @@ class Grid extends MultiChildRenderObjectWrapper { ...@@ -572,7 +572,7 @@ class Grid extends MultiChildRenderObjectWrapper {
} }
class Flex extends MultiChildRenderObjectWrapper { class Flex extends MultiChildRenderObjectWrapper {
Flex(List<Widget> children, { Flex(Iterable<Widget> children, {
Key key, Key key,
this.direction: FlexDirection.horizontal, this.direction: FlexDirection.horizontal,
this.justifyContent: FlexJustifyContent.start, this.justifyContent: FlexJustifyContent.start,
...@@ -615,7 +615,7 @@ class Flex extends MultiChildRenderObjectWrapper { ...@@ -615,7 +615,7 @@ class Flex extends MultiChildRenderObjectWrapper {
} }
class Row extends Flex { class Row extends Flex {
Row(List<Widget> children, { Row(Iterable<Widget> children, {
Key key, Key key,
justifyContent: FlexJustifyContent.start, justifyContent: FlexJustifyContent.start,
alignItems: FlexAlignItems.center, alignItems: FlexAlignItems.center,
...@@ -624,7 +624,7 @@ class Row extends Flex { ...@@ -624,7 +624,7 @@ class Row extends Flex {
} }
class Column extends Flex { class Column extends Flex {
Column(List<Widget> children, { Column(Iterable<Widget> children, {
Key key, Key key,
justifyContent: FlexJustifyContent.start, justifyContent: FlexJustifyContent.start,
alignItems: FlexAlignItems.center, alignItems: FlexAlignItems.center,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment