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

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

Issue 1209413006: Fix padding on Sky home screen scrollable list (Closed) Base URL: git@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/home.dart ('k') | sky/sdk/lib/widgets/fixed_height_scrollable.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 '../theme/colors.dart' as colors; 5 import '../theme/colors.dart' as colors;
6 import '../theme/edges.dart'; 6 import '../theme/edges.dart';
7 import 'basic.dart'; 7 import 'basic.dart';
8 import 'material.dart'; 8 import 'material.dart';
9 import "theme.dart"; 9 import "theme.dart";
10 10
11 class Card extends Component { 11 class Card extends Component {
12 Card({ String key, this.child, this.color }) : super(key: key); 12 Card({ String key, this.child, this.color }) : super(key: key);
13 13
14 final Widget child; 14 final Widget child;
15 final Color color; 15 final Color color;
16 16
17 Color get materialColor { 17 Color get materialColor {
18 if (color != null) 18 if (color != null)
19 return color; 19 return color;
20 switch (Theme.of(this).brightness) { 20 switch (Theme.of(this).brightness) {
21 case ThemeBrightness.light: 21 case ThemeBrightness.light:
22 return colors.White; 22 return colors.White;
23 case ThemeBrightness.dark: 23 case ThemeBrightness.dark:
24 return colors.Grey[800]; 24 return colors.Grey[800];
25 } 25 }
26 } 26 }
27 27
28 Widget build() { 28 Widget build() {
29 return new Container( 29 return new Container(
30 margin: const EdgeDims(8.0, 8.0, 0.0, 8.0), 30 margin: const EdgeDims.all(4.0),
31 child: new Material( 31 child: new Material(
32 color: materialColor, 32 color: materialColor,
33 edge: MaterialEdge.card, 33 edge: MaterialEdge.card,
34 level: 2, 34 level: 2,
35 child: new ClipRRect( 35 child: new ClipRRect(
36 xRadius: edges[MaterialEdge.card], 36 xRadius: edges[MaterialEdge.card],
37 yRadius: edges[MaterialEdge.card], 37 yRadius: edges[MaterialEdge.card],
38 child: child 38 child: child
39 ) 39 )
40 ) 40 )
41 ); 41 );
42 } 42 }
43 } 43 }
OLDNEW
« no previous file with comments | « sky/sdk/home.dart ('k') | sky/sdk/lib/widgets/fixed_height_scrollable.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698