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

Side by Side Diff: sky/sdk/lib/editing/input.dart

Issue 1217093005: Refactor stateful parts of Component into StatefulComponent (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: rebase Created 5 years, 5 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 | « sky/sdk/lib/editing/editable_text.dart ('k') | sky/sdk/lib/widgets/README.md » ('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 '../painting/text_style.dart'; 5 import '../painting/text_style.dart';
6 import '../widgets/basic.dart'; 6 import '../widgets/basic.dart';
7 import '../widgets/theme.dart'; 7 import '../widgets/theme.dart';
8 import 'editable_string.dart'; 8 import 'editable_string.dart';
9 import 'editable_text.dart'; 9 import 'editable_text.dart';
10 import 'keyboard.dart'; 10 import 'keyboard.dart';
11 11
12 typedef void ValueChanged(value); 12 typedef void ValueChanged(value);
13 13
14 const double _kHintOpacity = 0.26; 14 const double _kHintOpacity = 0.26;
15 const EdgeDims _kTextfieldPadding = const EdgeDims.symmetric(vertical: 8.0); 15 const EdgeDims _kTextfieldPadding = const EdgeDims.symmetric(vertical: 8.0);
16 16
17 class Input extends Component { 17 class Input extends StatefulComponent {
18 18
19 Input({String key, 19 Input({String key,
20 this.placeholder, 20 this.placeholder,
21 this.onChanged, 21 this.onChanged,
22 this.focused}) 22 this.focused})
23 : super(key: key, stateful: true) { 23 : super(key: key) {
24 _editableValue = new EditableString( 24 _editableValue = new EditableString(
25 text: _value, 25 text: _value,
26 onUpdated: _handleTextUpdated 26 onUpdated: _handleTextUpdated
27 ); 27 );
28 } 28 }
29 29
30 String placeholder; 30 String placeholder;
31 ValueChanged onChanged; 31 ValueChanged onChanged;
32 bool focused = false; 32 bool focused = false;
33 33
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 onPointerDown: (_) => keyboard.showByRequest() 99 onPointerDown: (_) => keyboard.showByRequest()
100 ); 100 );
101 } 101 }
102 102
103 void didUnmount() { 103 void didUnmount() {
104 if (_isAttachedToKeyboard) 104 if (_isAttachedToKeyboard)
105 keyboard.hide(); 105 keyboard.hide();
106 super.didUnmount(); 106 super.didUnmount();
107 } 107 }
108 } 108 }
OLDNEW
« no previous file with comments | « sky/sdk/lib/editing/editable_text.dart ('k') | sky/sdk/lib/widgets/README.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698