From 2f3baf14b3256ab7e9da8be647999ea79df34154 Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Sun, 6 Dec 2015 21:34:41 -0800 Subject: [PATCH] Parent data fixes Add some missing functionality to ParentData subclasses. Fixes #474 --- packages/flutter/lib/src/rendering/custom_layout.dart | 8 ++++++++ packages/flutter/lib/src/rendering/stack.dart | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/flutter/lib/src/rendering/custom_layout.dart b/packages/flutter/lib/src/rendering/custom_layout.dart index ab300bf394..b8ea63f01f 100644 --- a/packages/flutter/lib/src/rendering/custom_layout.dart +++ b/packages/flutter/lib/src/rendering/custom_layout.dart @@ -7,6 +7,14 @@ import 'object.dart'; class MultiChildLayoutParentData extends ContainerBoxParentDataMixin { Object id; + + void merge(MultiChildLayoutParentData other) { + if (other.id != null) + id = other.id; + super.merge(other); + } + + String toString() => '${super.toString()}; id=$id'; } abstract class MultiChildLayoutDelegate { diff --git a/packages/flutter/lib/src/rendering/stack.dart b/packages/flutter/lib/src/rendering/stack.dart index 946dc1cd6a..b89f17afd0 100644 --- a/packages/flutter/lib/src/rendering/stack.dart +++ b/packages/flutter/lib/src/rendering/stack.dart @@ -192,7 +192,7 @@ class StackParentData extends ContainerBoxParentDataMixin { /// children in the stack. bool get isPositioned => top != null || right != null || bottom != null || left != null || width != null || height != null; - String toString() => '${super.toString()}; top=$top; right=$right; bottom=$bottom, left=$left'; + String toString() => '${super.toString()}; top=$top; right=$right; bottom=$bottom; left=$left; width=$width; height=$height'; } abstract class RenderStackBase extends RenderBox