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

Unified Diff: sky/sdk/lib/framework/components2/floating_action_button.dart

Issue 1175683002: Add a shadow to the FloatingActionButton. (Closed) Base URL: git@github.com:/domokit/mojo.git@master
Patch Set: moved to painting/ Created 5 years, 6 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/sdk/BUILD.gn ('k') | sky/sdk/lib/framework/painting/shadows.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/lib/framework/components2/floating_action_button.dart
diff --git a/sky/sdk/lib/framework/components2/floating_action_button.dart b/sky/sdk/lib/framework/components2/floating_action_button.dart
index 08e7c74a02985b3346ce178c9e4afad1a89ec654..c6611c41cadc98522b4241c869c018cdcba4ca00 100644
--- a/sky/sdk/lib/framework/components2/floating_action_button.dart
+++ b/sky/sdk/lib/framework/components2/floating_action_button.dart
@@ -4,6 +4,7 @@
import '../fn2.dart';
import '../rendering/box.dart';
+import '../painting/shadows.dart';
import '../theme2/colors.dart';
import 'dart:sky' as sky;
import 'ink_well.dart';
@@ -28,7 +29,13 @@ class FloatingActionButton extends Component {
content: new CustomPaint(
callback: (sky.Canvas canvas) {
const double radius = _kSize / 2.0;
- canvas.drawCircle(radius, radius, radius, new sky.Paint()..color = Red[500]);
+ sky.Paint paint = new sky.Paint()..color = Red[500];
+ var builder = new ShadowDrawLooperBuilder()
+ ..addShadow(const sky.Size(0.0, 5.0),
+ const sky.Color(0x77000000),
+ 5.0);
+ paint.setDrawLooper(builder.build());
+ canvas.drawCircle(radius, radius, radius, paint);
},
child: new Container(
width: _kSize,
« no previous file with comments | « sky/sdk/BUILD.gn ('k') | sky/sdk/lib/framework/painting/shadows.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698