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

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

Issue 1226113007: Add @override annotation to known overriden methods (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 | « sky/sdk/lib/widgets/card.dart ('k') | sky/sdk/lib/widgets/default_text_style.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 // 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/widgets/theme.dart'; 7 import 'package:sky/widgets/theme.dart';
8 8
9 import 'basic.dart'; 9 import 'basic.dart';
10 import 'toggleable.dart'; 10 import 'toggleable.dart';
(...skipping 19 matching lines...) Expand all
30 /// Constructs a checkbox 30 /// Constructs a checkbox
31 /// 31 ///
32 /// * `value` determines whether the checkbox is checked. 32 /// * `value` determines whether the checkbox is checked.
33 /// * `onChanged` is called whenever the state of the checkbox should change. 33 /// * `onChanged` is called whenever the state of the checkbox should change.
34 Checkbox({ 34 Checkbox({
35 String key, 35 String key,
36 bool value, 36 bool value,
37 ValueChanged onChanged 37 ValueChanged onChanged
38 }) : super(key: key, value: value, onChanged: onChanged); 38 }) : super(key: key, value: value, onChanged: onChanged);
39 39
40 @override
40 Size get size => const Size(_kEdgeSize + 2.0, _kEdgeSize + 2.0); 41 Size get size => const Size(_kEdgeSize + 2.0, _kEdgeSize + 2.0);
41 42
43 @override
42 void customPaintCallback(sky.Canvas canvas, Size size) { 44 void customPaintCallback(sky.Canvas canvas, Size size) {
43 ThemeData themeData = Theme.of(this); 45 ThemeData themeData = Theme.of(this);
44 Color uncheckedColor = themeData.brightness == ThemeBrightness.light ? _kLig htUncheckedColor : _kDarkUncheckedColor; 46 Color uncheckedColor = themeData.brightness == ThemeBrightness.light ? _kLig htUncheckedColor : _kDarkUncheckedColor;
45 47
46 // Choose a color between grey and the theme color 48 // Choose a color between grey and the theme color
47 sky.Paint paint = new sky.Paint()..strokeWidth = 2.0 49 sky.Paint paint = new sky.Paint()..strokeWidth = 2.0
48 ..color = uncheckedColor; 50 ..color = uncheckedColor;
49 51
50 // The rrect contracts slightly during the animation 52 // The rrect contracts slightly during the animation
51 double inset = 2.0 - (toggleAnimation.value - _kMidpoint).abs() * 2.0; 53 double inset = 2.0 - (toggleAnimation.value - _kMidpoint).abs() * 2.0;
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 => new Point(p1.x * (1.0 - t) + p2.x * t, p1.y * (1.0 - t) + p2.y * t); 93 => new Point(p1.x * (1.0 - t) + p2.x * t, p1.y * (1.0 - t) + p2.y * t);
92 sky.Point drawStart = lerp(start, mid, 1.0 - t); 94 sky.Point drawStart = lerp(start, mid, 1.0 - t);
93 sky.Point drawEnd = lerp(mid, end, t); 95 sky.Point drawEnd = lerp(mid, end, t);
94 path.moveTo(drawStart.x, drawStart.y); 96 path.moveTo(drawStart.x, drawStart.y);
95 path.lineTo(mid.x, mid.y); 97 path.lineTo(mid.x, mid.y);
96 path.lineTo(drawEnd.x, drawEnd.y); 98 path.lineTo(drawEnd.x, drawEnd.y);
97 canvas.drawPath(path, paint); 99 canvas.drawPath(path, paint);
98 } 100 }
99 } 101 }
100 } 102 }
OLDNEW
« no previous file with comments | « sky/sdk/lib/widgets/card.dart ('k') | sky/sdk/lib/widgets/default_text_style.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698