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

Side by Side Diff: sky/sdk/lib/widgets/toggleable.dart

Issue 1235813006: Let the analyzer tell you if you've failed to override these methods by making them abstract instea… (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 5 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 import 'dart:sky' as sky; 5 import 'dart:sky' as sky;
6 6
7 import 'package:sky/animation/animation_performance.dart'; 7 import 'package:sky/animation/animation_performance.dart';
8 import 'package:sky/animation/curves.dart'; 8 import 'package:sky/animation/curves.dart';
9 import 'package:sky/widgets/animated_component.dart'; 9 import 'package:sky/widgets/animated_component.dart';
10 import 'package:sky/widgets/basic.dart'; 10 import 'package:sky/widgets/basic.dart';
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 performance.reverse(); 51 performance.reverse();
52 } 52 }
53 } 53 }
54 super.syncFields(source); 54 super.syncFields(source);
55 } 55 }
56 56
57 void _handleClick(sky.Event e) { 57 void _handleClick(sky.Event e) {
58 onChanged(!value); 58 onChanged(!value);
59 } 59 }
60 60
61 // Override these methods to draw yourself 61 // Override these to draw yourself
62 void customPaintCallback(sky.Canvas canvas, Size size) { 62 void customPaintCallback(sky.Canvas canvas, Size size);
63 assert(false); 63 Size get size;
64 } 64
65 Size get size => Size.zero;
66 EdgeDims get margin => const EdgeDims.symmetric(horizontal: 5.0); 65 EdgeDims get margin => const EdgeDims.symmetric(horizontal: 5.0);
67 double get duration => 200.0; 66 double get duration => 200.0;
68 Curve get curveUp => easeIn; 67 Curve get curveUp => easeIn;
69 Curve get curveDown => easeOut; 68 Curve get curveDown => easeOut;
70 69
71 Widget build() { 70 Widget build() {
72 return new Listener( 71 return new Listener(
73 child: new Container( 72 child: new Container(
74 margin: margin, 73 margin: margin,
75 width: size.width, 74 width: size.width,
76 height: size.height, 75 height: size.height,
77 child: new CustomPaint( 76 child: new CustomPaint(
78 token: position.value, 77 token: position.value,
79 callback: customPaintCallback 78 callback: customPaintCallback
80 ) 79 )
81 ), 80 ),
82 onGestureTap: _handleClick 81 onGestureTap: _handleClick
83 ); 82 );
84 } 83 }
85 } 84 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698