OLD | NEW |
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 15 matching lines...) Expand all Loading... |
26 | 26 |
27 return new Container( | 27 return new Container( |
28 style: _style, | 28 style: _style, |
29 children: children, | 29 children: children, |
30 key: _splashesKey | 30 key: _splashesKey |
31 )..events.listen('gesturescrollstart', _cancelSplashes) | 31 )..events.listen('gesturescrollstart', _cancelSplashes) |
32 ..events.listen('wheel', _cancelSplashes) | 32 ..events.listen('wheel', _cancelSplashes) |
33 ..events.listen('pointerdown', _startSplash); | 33 ..events.listen('pointerdown', _startSplash); |
34 } | 34 } |
35 | 35 |
36 sky.ClientRect _getBoundingRect() => getRoot().getBoundingClientRect(); | 36 sky.ClientRect _getBoundingRect() => (getRoot() as sky.Element).getBoundingCli
entRect(); |
37 | 37 |
38 void _startSplash(sky.Event event) { | 38 void _startSplash(sky.PointerEvent event) { |
39 setState(() { | 39 setState(() { |
40 if (_splashes == null) { | 40 if (_splashes == null) { |
41 _splashes = new LinkedHashSet<SplashAnimation>(); | 41 _splashes = new LinkedHashSet<SplashAnimation>(); |
42 } | 42 } |
43 | 43 |
44 var splash; | 44 var splash; |
45 splash = new SplashAnimation(_getBoundingRect(), event.x, event.y, | 45 splash = new SplashAnimation(_getBoundingRect(), event.x, event.y, |
46 onDone: () { _splashDone(splash); }); | 46 onDone: () { _splashDone(splash); }); |
47 | 47 |
48 _splashes.add(splash); | 48 _splashes.add(splash); |
(...skipping 22 matching lines...) Expand all Loading... |
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 } |
OLD | NEW |