| OLD | NEW |
| 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 '../fn2.dart'; | 5 import '../fn2.dart'; |
| 6 import '../rendering/box.dart'; | 6 import '../rendering/box.dart'; |
| 7 import '../painting/shadows.dart'; | 7 import '../painting/shadows.dart'; |
| 8 import '../theme2/colors.dart'; | 8 import '../theme2/colors.dart'; |
| 9 import 'dart:sky' as sky; | 9 import 'dart:sky' as sky; |
| 10 import 'ink_well.dart'; | 10 import 'ink_well.dart'; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 final int level; | 23 final int level; |
| 24 | 24 |
| 25 UINode build() { | 25 UINode build() { |
| 26 List<UINode> children = []; | 26 List<UINode> children = []; |
| 27 | 27 |
| 28 if (content != null) | 28 if (content != null) |
| 29 children.add(content); | 29 children.add(content); |
| 30 | 30 |
| 31 return new Material( | 31 return new Material( |
| 32 content: new CustomPaint( | 32 content: new CustomPaint( |
| 33 callback: (sky.Canvas canvas) { | 33 callback: (sky.Canvas canvas, Size size) { |
| 34 const double radius = _kSize / 2.0; | 34 const double radius = _kSize / 2.0; |
| 35 sky.Paint paint = new sky.Paint()..color = Red[500]; | 35 sky.Paint paint = new sky.Paint()..color = Red[500]; |
| 36 var builder = new ShadowDrawLooperBuilder() | 36 var builder = new ShadowDrawLooperBuilder() |
| 37 ..addShadow(const sky.Size(0.0, 5.0), | 37 ..addShadow(const sky.Size(0.0, 5.0), |
| 38 const sky.Color(0x77000000), | 38 const sky.Color(0x77000000), |
| 39 5.0); | 39 5.0); |
| 40 paint.setDrawLooper(builder.build()); | 40 paint.setDrawLooper(builder.build()); |
| 41 canvas.drawCircle(radius, radius, radius, paint); | 41 canvas.drawCircle(radius, radius, radius, paint); |
| 42 }, | 42 }, |
| 43 child: new ClipOval( | 43 child: new ClipOval( |
| 44 child: new Container( | 44 child: new Container( |
| 45 width: _kSize, | 45 width: _kSize, |
| 46 height: _kSize, | 46 height: _kSize, |
| 47 child: new InkWell(children: children) | 47 child: new InkWell(children: children) |
| 48 ) | 48 ) |
| 49 ) | 49 ) |
| 50 ), | 50 ), |
| 51 level: level); | 51 level: level); |
| 52 } | 52 } |
| 53 | 53 |
| 54 } | 54 } |
| OLD | NEW |