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

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

Issue 1187023005: Rename insert() to insertChildRoot() so it's consistent with detachChildRoot(). (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 unified diff | Download patch
« no previous file with comments | « no previous file | 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 'package:vector_math/vector_math.dart'; 5 import 'package:vector_math/vector_math.dart';
6 6
7 import '../painting/text_style.dart'; 7 import '../painting/text_style.dart';
8 import '../rendering/block.dart'; 8 import '../rendering/block.dart';
9 import '../rendering/box.dart'; 9 import '../rendering/box.dart';
10 import '../rendering/flex.dart'; 10 import '../rendering/flex.dart';
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 RenderParagraph get root => super.root; 352 RenderParagraph get root => super.root;
353 RenderParagraph createNode() => new RenderParagraph(text); 353 RenderParagraph createNode() => new RenderParagraph(text);
354 354
355 final InlineBase text; 355 final InlineBase text;
356 356
357 void syncRenderObject(Widget old) { 357 void syncRenderObject(Widget old) {
358 super.syncRenderObject(old); 358 super.syncRenderObject(old);
359 root.inline = text; 359 root.inline = text;
360 } 360 }
361 361
362 void insert(RenderObjectWrapper child, dynamic slot) { 362 void insertChildRoot(RenderObjectWrapper child, dynamic slot) {
363 assert(false); 363 assert(false);
364 // Inline does not support having children currently 364 // Inline does not support having children currently
365 } 365 }
366 366
367 } 367 }
368 368
369 class Text extends Component { 369 class Text extends Component {
370 Text(data, { String key, TextStyle this.style }) : data = data, super(key: key ); 370 Text(data, { String key, TextStyle this.style }) : data = data, super(key: key );
371 final String data; 371 final String data;
372 final TextStyle style; 372 final TextStyle style;
(...skipping 18 matching lines...) Expand all
391 391
392 final String src; 392 final String src;
393 final Size size; 393 final Size size;
394 394
395 void syncRenderObject(Widget old) { 395 void syncRenderObject(Widget old) {
396 super.syncRenderObject(old); 396 super.syncRenderObject(old);
397 root.src = src; 397 root.src = src;
398 root.requestedSize = size; 398 root.requestedSize = size;
399 } 399 }
400 400
401 void insert(RenderObjectWrapper child, dynamic slot) { 401 void insertChildRoot(RenderObjectWrapper child, dynamic slot) {
402 assert(false); 402 assert(false);
403 // Image does not support having children currently 403 // Image does not support having children currently
404 } 404 }
405 405
406 } 406 }
407 407
408 class WidgetToRenderBoxAdapter extends RenderObjectWrapper { 408 class WidgetToRenderBoxAdapter extends RenderObjectWrapper {
409 409
410 WidgetToRenderBoxAdapter(RenderBox renderBox) 410 WidgetToRenderBoxAdapter(RenderBox renderBox)
411 : this.renderBox = renderBox, 411 : this.renderBox = renderBox,
412 super(key: renderBox.hashCode.toString()); 412 super(key: renderBox.hashCode.toString());
413 413
414 RenderBox get root => super.root; 414 RenderBox get root => super.root;
415 RenderBox createNode() => this.renderBox; 415 RenderBox createNode() => this.renderBox;
416 416
417 final RenderBox renderBox; 417 final RenderBox renderBox;
418 418
419 void syncRenderObject(Widget old) { 419 void syncRenderObject(Widget old) {
420 super.syncRenderObject(old); 420 super.syncRenderObject(old);
421 if (old != null) { 421 if (old != null) {
422 assert(old is WidgetToRenderBoxAdapter); 422 assert(old is WidgetToRenderBoxAdapter);
423 assert(root == old.root); 423 assert(root == old.root);
424 } 424 }
425 } 425 }
426 426
427 void insert(RenderObjectWrapper child, dynamic slot) { 427 void insertChildRoot(RenderObjectWrapper child, dynamic slot) {
428 assert(false); 428 assert(false);
429 // WidgetToRenderBoxAdapter cannot have Widget children; by 429 // WidgetToRenderBoxAdapter cannot have Widget children; by
430 // definition, it is the transition out of the Widget world. 430 // definition, it is the transition out of the Widget world.
431 } 431 }
432 432
433 void remove() { 433 void remove() {
434 parent.detachChildRoot(this); 434 parent.detachChildRoot(this);
435 super.remove(); 435 super.remove();
436 } 436 }
437 437
438 } 438 }
OLDNEW
« no previous file with comments | « no previous file | sky/sdk/lib/widgets/scaffold.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698