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

Unified Diff: sky/examples/fn/widgets/material.dart

Issue 993033003: Move example fn widgets into sky/framework/components (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: 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/examples/fn/widgets/inksplash.dart ('k') | sky/examples/fn/widgets/menudivider.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/examples/fn/widgets/material.dart
diff --git a/sky/examples/fn/widgets/material.dart b/sky/examples/fn/widgets/material.dart
deleted file mode 100644
index b0a828295d6e653dfcba404c0d0fd19388081b7f..0000000000000000000000000000000000000000
--- a/sky/examples/fn/widgets/material.dart
+++ /dev/null
@@ -1,80 +0,0 @@
-part of widgets;
-
-abstract class MaterialComponent extends Component {
-
- static const _splashesKey = const Object();
-
- static Style _style = new Style('''
- transform: translateX(0);
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0'''
- );
-
- LinkedHashSet<SplashAnimation> _splashes;
-
- MaterialComponent({ Object key }) : super(key: key);
-
- Node build() {
- List<Node> children = [];
-
- if (_splashes != null) {
- children.addAll(_splashes.map((s) => new InkSplash(s.onStyleChanged)));
- }
-
- return new Container(
- style: _style,
- children: children,
- key: _splashesKey
- )..events.listen('gesturescrollstart', _cancelSplashes)
- ..events.listen('wheel', _cancelSplashes)
- ..events.listen('pointerdown', _startSplash);
- }
-
- sky.ClientRect _getBoundingRect() => (getRoot() as sky.Element).getBoundingClientRect();
-
- void _startSplash(sky.PointerEvent event) {
- setState(() {
- if (_splashes == null) {
- _splashes = new LinkedHashSet<SplashAnimation>();
- }
-
- var splash;
- splash = new SplashAnimation(_getBoundingRect(), event.x, event.y,
- onDone: () { _splashDone(splash); });
-
- _splashes.add(splash);
- });
- }
-
- void _cancelSplashes(sky.Event event) {
- if (_splashes == null) {
- return;
- }
-
- setState(() {
- var splashes = _splashes;
- _splashes = null;
- splashes.forEach((s) { s.cancel(); });
- });
- }
-
- void didUnmount() {
- _cancelSplashes(null);
- }
-
- void _splashDone(SplashAnimation splash) {
- if (_splashes == null) {
- return;
- }
-
- setState(() {
- _splashes.remove(splash);
- if (_splashes.length == 0) {
- _splashes = null;
- }
- });
- }
-}
« no previous file with comments | « sky/examples/fn/widgets/inksplash.dart ('k') | sky/examples/fn/widgets/menudivider.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698