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

Side by Side Diff: sky/sdk/lib/widgets/basic.dart

Issue 1209233002: Let's hide double.INFINITY a bit more, by providing cleaner APIs for the cases where we're currentl… (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 5 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 unified diff | Download patch
« no previous file with comments | « sky/sdk/lib/rendering/stack.dart ('k') | sky/sdk/lib/widgets/scaffold.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « sky/sdk/lib/rendering/stack.dart ('k') | sky/sdk/lib/widgets/scaffold.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698