| 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 '../editing/editable_string.dart'; | 5 import '../editing/editable_string.dart'; | 
| 6 import '../editing/editable_text.dart'; | 6 import '../editing/editable_text.dart'; | 
| 7 import '../editing/keyboard.dart'; | 7 import '../editing/keyboard.dart'; | 
| 8 import '../fn.dart'; | 8 import '../fn.dart'; | 
| 9 import '../theme/colors.dart'; | 9 import '../theme/colors.dart'; | 
| 10 import '../theme/typography.dart' as typography; | 10 import '../theme/typography.dart' as typography; | 
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 58 | 58 | 
| 59   void _handleTextUpdated() { | 59   void _handleTextUpdated() { | 
| 60     scheduleBuild(); | 60     scheduleBuild(); | 
| 61     if (_value != _editableValue.text) { | 61     if (_value != _editableValue.text) { | 
| 62       _value = _editableValue.text; | 62       _value = _editableValue.text; | 
| 63       if (onChanged != null) | 63       if (onChanged != null) | 
| 64         onChanged(_value); | 64         onChanged(_value); | 
| 65     } | 65     } | 
| 66   } | 66   } | 
| 67 | 67 | 
| 68   Node build() { | 68   UINode build() { | 
| 69     if (focused && !_isAttachedToKeyboard) { | 69     if (focused && !_isAttachedToKeyboard) { | 
| 70       keyboard.show(_editableValue.stub); | 70       keyboard.show(_editableValue.stub); | 
| 71       _isAttachedToKeyboard = true; | 71       _isAttachedToKeyboard = true; | 
| 72     } | 72     } | 
| 73 | 73 | 
| 74     List<Node> children = []; | 74     List<UINode> children = []; | 
| 75 | 75 | 
| 76     if (placeholder != null && _value.isEmpty) { | 76     if (placeholder != null && _value.isEmpty) { | 
| 77       children.add(new Container( | 77       children.add(new Container( | 
| 78           style: _placeholderStyle, | 78           style: _placeholderStyle, | 
| 79           children: [new Text(placeholder)] | 79           children: [new Text(placeholder)] | 
| 80       )); | 80       )); | 
| 81     } | 81     } | 
| 82 | 82 | 
| 83     children.add(new EditableText(value: _editableValue, focused: focused)); | 83     children.add(new EditableText(value: _editableValue, focused: focused)); | 
| 84 | 84 | 
| 85     return new Container( | 85     return new Container( | 
| 86       style: _style, | 86       style: _style, | 
| 87       inlineStyle: focused ? _focusedInlineStyle : null, | 87       inlineStyle: focused ? _focusedInlineStyle : null, | 
| 88       children: children | 88       children: children | 
| 89     ); | 89     ); | 
| 90   } | 90   } | 
| 91 } | 91 } | 
| OLD | NEW | 
|---|