| 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:async'; | 5 import 'dart:async'; |
| 6 import 'dart:sky' as sky; | 6 import 'dart:sky' as sky; |
| 7 | 7 |
| 8 import '../painting/text_style.dart'; | 8 import 'package:sky/editing/editable_string.dart'; |
| 9 import '../rendering/object.dart'; | 9 import 'package:sky/painting/text_style.dart'; |
| 10 import '../widgets/basic.dart'; | 10 import 'package:sky/rendering/object.dart'; |
| 11 import 'editable_string.dart'; | 11 import 'package:sky/widgets/basic.dart'; |
| 12 | 12 |
| 13 const _kCursorBlinkPeriod = 500; // milliseconds | 13 const _kCursorBlinkPeriod = 500; // milliseconds |
| 14 const _kCursorGap = 1.0; | 14 const _kCursorGap = 1.0; |
| 15 const _kCursorHeightOffset = 2.0; | 15 const _kCursorHeightOffset = 2.0; |
| 16 const _kCursorWidth = 1.0; | 16 const _kCursorWidth = 1.0; |
| 17 | 17 |
| 18 class EditableText extends StatefulComponent { | 18 class EditableText extends StatefulComponent { |
| 19 | 19 |
| 20 EditableText({ | 20 EditableText({ |
| 21 String key, | 21 String key, |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 | 101 |
| 102 Widget cursor = new Container( | 102 Widget cursor = new Container( |
| 103 height: style.fontSize, | 103 height: style.fontSize, |
| 104 width: _kCursorGap + _kCursorWidth, | 104 width: _kCursorGap + _kCursorWidth, |
| 105 child: new CustomPaint(callback: _paintCursor, token: _showCursor) | 105 child: new CustomPaint(callback: _paintCursor, token: _showCursor) |
| 106 ); | 106 ); |
| 107 | 107 |
| 108 return new Flex([text, cursor]); | 108 return new Flex([text, cursor]); |
| 109 } | 109 } |
| 110 } | 110 } |
| OLD | NEW |