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

Unified Diff: sky/framework/components/button_base.dart

Issue 993033003: Move example fn widgets into sky/framework/components (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 | « sky/framework/components/button.dart ('k') | sky/framework/components/checkbox.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/framework/components/button_base.dart
diff --git a/sky/examples/fn/widgets/buttonbase.dart b/sky/framework/components/button_base.dart
similarity index 53%
rename from sky/examples/fn/widgets/buttonbase.dart
rename to sky/framework/components/button_base.dart
index a69202280188acaf268d3e7b3b446d76bc401dbd..baf590a44e7afd149e12803bb21e6e473247f42e 100644
--- a/sky/examples/fn/widgets/buttonbase.dart
+++ b/sky/framework/components/button_base.dart
@@ -1,8 +1,12 @@
-part of widgets;
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
-abstract class ButtonBase extends MaterialComponent {
+import '../fn.dart';
+import 'material.dart';
- bool _highlight = false;
+abstract class ButtonBase extends Material {
+ bool highlight = false;
ButtonBase({ Object key }) : super(key: key) {
events.listen('pointerdown', _handlePointerDown);
@@ -12,17 +16,17 @@ abstract class ButtonBase extends MaterialComponent {
void _handlePointerDown(_) {
setState(() {
- _highlight = true;
+ highlight = true;
});
}
void _handlePointerUp(_) {
setState(() {
- _highlight = false;
+ highlight = false;
});
}
void _handlePointerCancel(_) {
setState(() {
- _highlight = false;
+ highlight = false;
});
}
}
« no previous file with comments | « sky/framework/components/button.dart ('k') | sky/framework/components/checkbox.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698