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

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

Issue 1191153002: Make back button control drawer in stocks app (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: abarth feedback 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
« no previous file with comments | « sky/examples/widgets/navigation.dart ('k') | sky/sdk/lib/widgets/navigator.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/lib/widgets/drawer.dart
diff --git a/sky/sdk/lib/widgets/drawer.dart b/sky/sdk/lib/widgets/drawer.dart
index 67eccd310dc234ba8c71b2ed348b1729f95bfbaa..ac84a95b04a4f92fec8fb9ce953c75dd2e355ea0 100644
--- a/sky/sdk/lib/widgets/drawer.dart
+++ b/sky/sdk/lib/widgets/drawer.dart
@@ -54,9 +54,9 @@ class DrawerController {
bool get isClosed => position.value == -_kWidth;
bool get _isMostlyClosed => position.value <= -_kWidth / 2;
- void toggle() => _isMostlyClosed ? _open() : _close();
+ void toggle() => _isMostlyClosed ? open() : close();
- void handleMaskTap(_) => _close();
+ void handleMaskTap(_) => close();
void handlePointerDown(_) => position.stop();
void handlePointerMove(sky.PointerEvent event) {
@@ -75,11 +75,11 @@ class DrawerController {
_settle();
}
- void _open() => _animateToPosition(0.0);
+ void open() => _animateToPosition(0.0);
- void _close() => _animateToPosition(-_kWidth);
+ void close() => _animateToPosition(-_kWidth);
- void _settle() => _isMostlyClosed ? _close() : _open();
+ void _settle() => _isMostlyClosed ? close() : open();
void _animateToPosition(double targetPosition) {
double distance = (targetPosition - position.value).abs();
« no previous file with comments | « sky/examples/widgets/navigation.dart ('k') | sky/sdk/lib/widgets/navigator.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698