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

Unified Diff: sky/sdk/lib/widgets/card.dart

Issue 1218153005: Refactoring to support dark theme better (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: fix import issues 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/sdk/lib/theme/theme_data.dart ('k') | sky/sdk/lib/widgets/checkbox.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/lib/widgets/card.dart
diff --git a/sky/sdk/lib/widgets/card.dart b/sky/sdk/lib/widgets/card.dart
index 6c373768631664a42a1203009195ffa0f306b62f..dca8b55bac83c3b5093fc89c577c52fad43da69f 100644
--- a/sky/sdk/lib/widgets/card.dart
+++ b/sky/sdk/lib/widgets/card.dart
@@ -3,7 +3,6 @@
// found in the LICENSE file.
import '../theme/colors.dart' as colors;
-import '../theme/edges.dart';
import 'basic.dart';
import 'material.dart';
import "theme.dart";
@@ -14,27 +13,16 @@ class Card extends Component {
final Widget child;
final Color color;
- Color get materialColor {
- if (color != null)
- return color;
- switch (Theme.of(this).brightness) {
- case ThemeBrightness.light:
- return colors.White;
- case ThemeBrightness.dark:
- return colors.Grey[800];
- }
- }
-
Widget build() {
return new Container(
margin: const EdgeDims.all(4.0),
child: new Material(
- color: materialColor,
- edge: MaterialEdge.card,
+ color: color,
+ type: MaterialType.card,
level: 2,
child: new ClipRRect(
- xRadius: edges[MaterialEdge.card],
- yRadius: edges[MaterialEdge.card],
+ xRadius: edges[MaterialType.card],
+ yRadius: edges[MaterialType.card],
child: child
)
)
« no previous file with comments | « sky/sdk/lib/theme/theme_data.dart ('k') | sky/sdk/lib/widgets/checkbox.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698