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

Side by Side Diff: sky/framework/components/input.dart

Issue 1016093002: Begin work on the PopupMenu entrance animation (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 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/framework/components/drawer.dart ('k') | sky/framework/components/popup_menu.dart » ('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 '../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 10
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 Input({Object key, 45 Input({Object key,
46 this.placeholder, 46 this.placeholder,
47 this.onChanged, 47 this.onChanged,
48 this.focused}) 48 this.focused})
49 : super(key: key, stateful: true) { 49 : super(key: key, stateful: true) {
50 _editableValue = new EditableString(text: _value, 50 _editableValue = new EditableString(text: _value,
51 onUpdated: _handleTextUpdated); 51 onUpdated: _handleTextUpdated);
52 } 52 }
53 53
54 void _handleTextUpdated() { 54 void _handleTextUpdated() {
55 setState(() {}); 55 scheduleBuild();
56 if (_value != _editableValue.text) { 56 if (_value != _editableValue.text) {
57 _value = _editableValue.text; 57 _value = _editableValue.text;
58 if (onChanged != null) 58 if (onChanged != null)
59 onChanged(_value); 59 onChanged(_value);
60 } 60 }
61 } 61 }
62 62
63 void didUnmount() { 63 void didUnmount() {
64 if (_isAttachedToKeyboard) 64 if (_isAttachedToKeyboard)
65 keyboard.hide(); 65 keyboard.hide();
(...skipping 16 matching lines...) Expand all
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 }
OLDNEW
« no previous file with comments | « sky/framework/components/drawer.dart ('k') | sky/framework/components/popup_menu.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698