| 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 'package:vector_math/vector_math.dart'; | 5 import 'package:vector_math/vector_math.dart'; |
| 6 | 6 |
| 7 import '../rendering/block.dart'; | 7 import '../rendering/block.dart'; |
| 8 import '../rendering/box.dart'; | 8 import '../rendering/box.dart'; |
| 9 import '../rendering/flex.dart'; | 9 import '../rendering/flex.dart'; |
| 10 import '../rendering/object.dart'; | 10 import '../rendering/object.dart'; |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 } | 339 } |
| 340 | 340 |
| 341 } | 341 } |
| 342 | 342 |
| 343 class Flexible extends ParentDataNode { | 343 class Flexible extends ParentDataNode { |
| 344 Flexible({ String key, Widget child, int flex: 1 }) | 344 Flexible({ String key, Widget child, int flex: 1 }) |
| 345 : super(child, new FlexBoxParentData()..flex = flex, key: key); | 345 : super(child, new FlexBoxParentData()..flex = flex, key: key); |
| 346 } | 346 } |
| 347 | 347 |
| 348 class Inline extends RenderObjectWrapper { | 348 class Inline extends RenderObjectWrapper { |
| 349 Inline({ Object key, this.text }) : super(key: key); | 349 Inline({ String key, this.text }) : super(key: key); |
| 350 | 350 |
| 351 RenderParagraph get root => super.root; | 351 RenderParagraph get root => super.root; |
| 352 RenderParagraph createNode() => new RenderParagraph(text); | 352 RenderParagraph createNode() => new RenderParagraph(text); |
| 353 | 353 |
| 354 final InlineBase text; | 354 final InlineBase text; |
| 355 | 355 |
| 356 void syncRenderObject(Widget old) { | 356 void syncRenderObject(Widget old) { |
| 357 super.syncRenderObject(old); | 357 super.syncRenderObject(old); |
| 358 root.inline = text; | 358 root.inline = text; |
| 359 } | 359 } |
| 360 | 360 |
| 361 void insert(RenderObjectWrapper child, dynamic slot) { | 361 void insert(RenderObjectWrapper child, dynamic slot) { |
| 362 assert(false); | 362 assert(false); |
| 363 // Inline does not support having children currently | 363 // Inline does not support having children currently |
| 364 } | 364 } |
| 365 | 365 |
| 366 } | 366 } |
| 367 | 367 |
| 368 class Text extends Component { | 368 class Text extends Component { |
| 369 Text(this.data, { TextStyle this.style }) : super(key: '*text*'); | 369 Text(data, { String key, TextStyle this.style }) : data = data, super(key: key
); |
| 370 final String data; | 370 final String data; |
| 371 final TextStyle style; | 371 final TextStyle style; |
| 372 bool get interchangeable => true; | 372 bool get interchangeable => true; |
| 373 Widget build() { | 373 Widget build() { |
| 374 InlineBase text = new InlineText(data); | 374 InlineBase text = new InlineText(data); |
| 375 if (style != null) text = new InlineStyle(style, [text]); | 375 if (style != null) text = new InlineStyle(style, [text]); |
| 376 return new Inline(text: text); | 376 return new Inline(text: text); |
| 377 } | 377 } |
| 378 } | 378 } |
| 379 | 379 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 } | 423 } |
| 424 } | 424 } |
| 425 | 425 |
| 426 void insert(RenderObjectWrapper child, dynamic slot) { | 426 void insert(RenderObjectWrapper child, dynamic slot) { |
| 427 assert(false); | 427 assert(false); |
| 428 // WidgetToRenderBoxAdapter cannot have Widget children; by | 428 // WidgetToRenderBoxAdapter cannot have Widget children; by |
| 429 // definition, it is the transition out of the Widget world. | 429 // definition, it is the transition out of the Widget world. |
| 430 } | 430 } |
| 431 | 431 |
| 432 } | 432 } |
| OLD | NEW |