Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Unified Diff: sky/sdk/lib/widgets/scaffold.dart

Issue 1213473003: Add asserts to catch potential misuses of the rendering framework. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/sdk/lib/rendering/stack.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/lib/widgets/scaffold.dart
diff --git a/sky/sdk/lib/widgets/scaffold.dart b/sky/sdk/lib/widgets/scaffold.dart
index e975e516b8419fce60d8eb4dc8cc9aa0cb96fdcb..6f9208db97f050e76e6e5640511ab0e0485769b4 100644
--- a/sky/sdk/lib/widgets/scaffold.dart
+++ b/sky/sdk/lib/widgets/scaffold.dart
@@ -39,9 +39,12 @@ class RenderScaffold extends RenderBox {
return;
if (old != null)
dropChild(old);
- _slots[slot] = value;
- if (value != null)
+ if (value == null) {
+ _slots.remove(slot);
+ } else {
+ _slots[slot] = value;
adoptChild(value);
+ }
markNeedsLayout();
}
@@ -118,7 +121,7 @@ class RenderScaffold extends RenderBox {
if (_slots[ScaffoldSlots.floatingActionButton] != null) {
RenderBox floatingActionButton = _slots[ScaffoldSlots.floatingActionButton];
Size area = new Size(size.width - kButtonX, size.height - kButtonY);
- floatingActionButton.layout(new BoxConstraints.loose(area));
+ floatingActionButton.layout(new BoxConstraints.loose(area), parentUsesSize: true);
assert(floatingActionButton.parentData is BoxParentData);
floatingActionButton.parentData.position = (area - floatingActionButton.size).toPoint();
}
« no previous file with comments | « sky/sdk/lib/rendering/stack.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698