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

Unified Diff: sky/sdk/lib/widgets/icon_button.dart

Issue 1188993003: Use semantic names for callbacks instead of onGestureTap (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 6 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
Index: sky/sdk/lib/widgets/icon_button.dart
diff --git a/sky/sdk/lib/widgets/icon_button.dart b/sky/sdk/lib/widgets/icon_button.dart
index a7ae568a096047ab0ac1d5271319b48caf98ddf0..2b39ec2579ba5520710d694052ab318738eb88bd 100644
--- a/sky/sdk/lib/widgets/icon_button.dart
+++ b/sky/sdk/lib/widgets/icon_button.dart
@@ -9,18 +9,22 @@ import 'widget.dart';
class IconButton extends Component {
- IconButton({ String icon: '', this.onGestureTap })
+ IconButton({ String icon: '', this.onPressed })
: super(key: icon), icon = icon;
final String icon;
- final GestureEventListener onGestureTap;
+ final Function onPressed;
Widget build() {
return new Listener(
child: new Padding(
child: new Icon(type: icon, size: 24),
padding: const EdgeDims.all(8.0)),
- onGestureTap: onGestureTap);
+ onGestureTap: (_) {
+ if (onPressed != null)
+ onPressed();
+ }
+ );
}
}

Powered by Google App Engine
This is Rietveld 408576698