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

Unified Diff: sky/sdk/lib/framework/components2/scrollable.dart

Issue 1175753003: Kill onDidMount()/onDidUnmount() in favour of just overriding the relevant methods. (Closed) Base URL: https://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/framework/components2/scrollable.dart
diff --git a/sky/sdk/lib/framework/components2/scrollable.dart b/sky/sdk/lib/framework/components2/scrollable.dart
index b43583325d934573a60ccf0bc7425b7125fae87c..dee2c137335f2e4647d5b4a3700459085341f169 100644
--- a/sky/sdk/lib/framework/components2/scrollable.dart
+++ b/sky/sdk/lib/framework/components2/scrollable.dart
@@ -23,9 +23,7 @@ abstract class ScrollClient {
abstract class Scrollable extends Component {
- Scrollable({Object key}) : super(key: key, stateful: true) {
- onDidUnmount(_stopSimulation);
- }
+ Scrollable({Object key}) : super(key: key, stateful: true);
void syncFields(Scrollable source) { }
@@ -102,6 +100,11 @@ abstract class Scrollable extends Component {
return scrollTo(newScrollOffset);
}
+ void didUnmount() {
+ _stopSimulation();
+ super.didUnmount();
+ }
+
void _stopSimulation() {
if (_simulation == null)
return;
« no previous file with comments | « sky/sdk/lib/framework/components2/popup_menu.dart ('k') | sky/sdk/lib/framework/editing2/editable_text.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698