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

Unified Diff: sky/examples/editor/editable_string.dart

Issue 999553002: Make a material design Input component (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sky/examples/editor/editable_text.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/examples/editor/editable_string.dart
diff --git a/sky/examples/editor/editable_string.dart b/sky/examples/editor/editable_string.dart
index aa60b4007fa1979ee312eb068476b25ac54b2f58..79ff0811e1d8dd6e0fc8917e27ac225bc581d3e1 100644
--- a/sky/examples/editor/editable_string.dart
+++ b/sky/examples/editor/editable_string.dart
@@ -4,7 +4,7 @@
import 'package:sky/services/keyboard/keyboard.mojom.dart';
-typedef void StringChangedCallback(EditableString updated);
+typedef void StringUpdated();
class TextRange {
final int start;
@@ -23,11 +23,11 @@ class EditableString implements KeyboardClient {
TextRange composing = const TextRange.empty();
TextRange selection = const TextRange.empty();
- final StringChangedCallback onChanged;
+ final StringUpdated onUpdated;
KeyboardClientStub stub;
- EditableString({this.text: '', this.onChanged}) {
+ EditableString({this.text: '', this.onUpdated}) {
stub = new KeyboardClientStub.unbound()..impl = this;
}
@@ -85,7 +85,7 @@ class EditableString implements KeyboardClient {
TextRange committedRange = _replaceOrAppend(composing, text);
selection = new TextRange.collapsed(committedRange.end);
composing = const TextRange.empty();
- onChanged(this);
+ onUpdated();
}
void deleteSurroundingText(int beforeLength, int afterLength) {
@@ -97,23 +97,23 @@ class EditableString implements KeyboardClient {
_delete(beforeRange);
selection = new TextRange(start: selection.start - beforeLength,
end: selection.end - beforeLength);
- onChanged(this);
+ onUpdated();
}
void setComposingRegion(int start, int end) {
composing = new TextRange(start: start, end: end);
- onChanged(this);
+ onUpdated();
}
void setComposingText(String text, int newCursorPosition) {
// TODO(abarth): Why is |newCursorPosition| always 1?
composing = _replaceOrAppend(composing, text);
selection = new TextRange.collapsed(composing.end);
- onChanged(this);
+ onUpdated();
}
void setSelection(int start, int end) {
selection = new TextRange(start: start, end: end);
- onChanged(this);
+ onUpdated();
}
}
« no previous file with comments | « no previous file | sky/examples/editor/editable_text.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698