| 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 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 final InlineBase text; | 374 final InlineBase text; |
| 375 | 375 |
| 376 void syncRenderObject(Widget old) { | 376 void syncRenderObject(Widget old) { |
| 377 super.syncRenderObject(old); | 377 super.syncRenderObject(old); |
| 378 root.inline = text; | 378 root.inline = text; |
| 379 } | 379 } |
| 380 | 380 |
| 381 } | 381 } |
| 382 | 382 |
| 383 class Text extends Component { | 383 class Text extends Component { |
| 384 Text(data, { String key, TextStyle this.style }) : super(key: key); | 384 Text(this.data, { String key, TextStyle this.style }) : super(key: key); |
| 385 final String data; | 385 final String data; |
| 386 final TextStyle style; | 386 final TextStyle style; |
| 387 bool get interchangeable => true; | 387 bool get interchangeable => true; |
| 388 Widget build() { | 388 Widget build() { |
| 389 InlineBase text = new InlineText(data); | 389 InlineBase text = new InlineText(data); |
| 390 if (style != null) text = new InlineStyle(style, [text]); | 390 if (style != null) text = new InlineStyle(style, [text]); |
| 391 return new Inline(text: text); | 391 return new Inline(text: text); |
| 392 } | 392 } |
| 393 } | 393 } |
| 394 | 394 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 assert(root == old.root); | 434 assert(root == old.root); |
| 435 } | 435 } |
| 436 } | 436 } |
| 437 | 437 |
| 438 void remove() { | 438 void remove() { |
| 439 parent.detachChildRoot(this); | 439 parent.detachChildRoot(this); |
| 440 super.remove(); | 440 super.remove(); |
| 441 } | 441 } |
| 442 | 442 |
| 443 } | 443 } |
| OLD | NEW |