OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 import 'dart:sky' as sky; | 5 import 'dart:sky' as sky; |
6 | 6 |
7 import 'package:vector_math/vector_math.dart'; | 7 import 'package:vector_math/vector_math.dart'; |
8 | 8 |
9 import '../painting/text_style.dart'; | 9 import '../painting/text_style.dart'; |
10 import '../rendering/block.dart'; | 10 import '../rendering/block.dart'; |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 final EdgeDims margin; | 283 final EdgeDims margin; |
284 final EdgeDims padding; | 284 final EdgeDims padding; |
285 final Matrix4 transform; | 285 final Matrix4 transform; |
286 final double width; | 286 final double width; |
287 final double height; | 287 final double height; |
288 | 288 |
289 Widget build() { | 289 Widget build() { |
290 Widget current = child; | 290 Widget current = child; |
291 | 291 |
292 if (child == null && width == null && height == null) | 292 if (child == null && width == null && height == null) |
293 current = new SizedBox( | 293 current = new ConstrainedBox(constraints: BoxConstraints.expand); |
294 width: double.INFINITY, | |
295 height: double.INFINITY | |
296 ); | |
297 | 294 |
298 if (padding != null) | 295 if (padding != null) |
299 current = new Padding(padding: padding, child: current); | 296 current = new Padding(padding: padding, child: current); |
300 | 297 |
301 if (decoration != null) | 298 if (decoration != null) |
302 current = new DecoratedBox(decoration: decoration, child: current); | 299 current = new DecoratedBox(decoration: decoration, child: current); |
303 | 300 |
304 if (width != null || height != null) | 301 if (width != null || height != null) |
305 current = new SizedBox( | 302 current = new SizedBox( |
306 width: width, | 303 width: width, |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
492 } | 489 } |
493 | 490 |
494 void remove() { | 491 void remove() { |
495 RenderObjectWrapper ancestor = findAncestor(RenderObjectWrapper); | 492 RenderObjectWrapper ancestor = findAncestor(RenderObjectWrapper); |
496 assert(ancestor is RenderObjectWrapper); | 493 assert(ancestor is RenderObjectWrapper); |
497 ancestor.detachChildRoot(this); | 494 ancestor.detachChildRoot(this); |
498 super.remove(); | 495 super.remove(); |
499 } | 496 } |
500 | 497 |
501 } | 498 } |
OLD | NEW |