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

Side by Side Diff: sky/examples/fn/widgets/material.dart

Issue 985853002: Effen: willUmount->didUnmount, allow setState after didUnmount (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: cr comments 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 unified diff | Download patch
« no previous file with comments | « sky/examples/fn/widgets/fixedheightscrollable.dart ('k') | sky/framework/fn.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 part of widgets; 1 part of widgets;
2 2
3 abstract class MaterialComponent extends Component { 3 abstract class MaterialComponent extends Component {
4 4
5 static const _splashesKey = const Object(); 5 static const _splashesKey = const Object();
6 6
7 static Style _style = new Style(''' 7 static Style _style = new Style('''
8 transform: translateX(0); 8 transform: translateX(0);
9 position: absolute; 9 position: absolute;
10 top: 0; 10 top: 0;
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 return; 54 return;
55 } 55 }
56 56
57 setState(() { 57 setState(() {
58 var splashes = _splashes; 58 var splashes = _splashes;
59 _splashes = null; 59 _splashes = null;
60 splashes.forEach((s) { s.cancel(); }); 60 splashes.forEach((s) { s.cancel(); });
61 }); 61 });
62 } 62 }
63 63
64 void willUnmount() { 64 void didUnmount() {
65 _cancelSplashes(null); 65 _cancelSplashes(null);
66 } 66 }
67 67
68 void _splashDone(SplashAnimation splash) { 68 void _splashDone(SplashAnimation splash) {
69 if (_splashes == null) { 69 if (_splashes == null) {
70 return; 70 return;
71 } 71 }
72 72
73 setState(() { 73 setState(() {
74 _splashes.remove(splash); 74 _splashes.remove(splash);
75 if (_splashes.length == 0) { 75 if (_splashes.length == 0) {
76 _splashes = null; 76 _splashes = null;
77 } 77 }
78 }); 78 });
79 } 79 }
80 } 80 }
OLDNEW
« no previous file with comments | « sky/examples/fn/widgets/fixedheightscrollable.dart ('k') | sky/framework/fn.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698