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

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

Issue 1027633003: [Effen] Add AnimatedComponent base class (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: cr changes 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/popup_menu_item.dart ('k') | sky/framework/editing/editable_text.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/framework/components/scrollable.dart
diff --git a/sky/framework/components/scrollable.dart b/sky/framework/components/scrollable.dart
index 9d4fc6a79dd64f0de19f97fa2bea30d50f2fa867..5590bf9e0e7a09da9f8454c8041e50e70d7c6047 100644
--- a/sky/framework/components/scrollable.dart
+++ b/sky/framework/components/scrollable.dart
@@ -24,7 +24,9 @@ abstract class Scrollable extends Component {
double _scrollOffset = 0.0;
Simulation _simulation;
- Scrollable({Object key, this.scrollBehavior}) : super(key: key);
+ Scrollable({Object key, this.scrollBehavior}) : super(key: key) {
+ onDidUnmount(_stopSimulation);
+ }
Node buildContent();
@@ -41,11 +43,6 @@ abstract class Scrollable extends Component {
);
}
- void didUnmount() {
- super.didUnmount();
- _stopSimulation();
- }
-
bool scrollBy(double scrollDelta) {
var newScrollOffset = scrollBehavior.applyCurve(_scrollOffset, scrollDelta);
if (newScrollOffset == _scrollOffset)
« no previous file with comments | « sky/framework/components/popup_menu_item.dart ('k') | sky/framework/editing/editable_text.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698