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

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

Issue 1216923008: Fix test failures from my previous animation patch. (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
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 '../base/lerp.dart'; 5 import '../base/lerp.dart';
6 import '../animation/animated_value.dart'; 6 import '../animation/animated_value.dart';
7 import '../painting/box_painter.dart'; 7 import '../painting/box_painter.dart';
8 import '../theme/edges.dart'; 8 import '../theme/edges.dart';
9 import '../theme/shadows.dart'; 9 import '../theme/shadows.dart';
10 import 'animated_component.dart'; 10 import 'animated_component.dart';
(...skipping 21 matching lines...) Expand all
32 32
33 class Material extends AnimatedComponent { 33 class Material extends AnimatedComponent {
34 34
35 Material({ 35 Material({
36 String key, 36 String key,
37 this.child, 37 this.child,
38 this.edge: MaterialEdge.card, 38 this.edge: MaterialEdge.card,
39 int level: 0, 39 int level: 0,
40 this.color 40 this.color
41 }) : super(key: key) { 41 }) : super(key: key) {
42 this.level = new AnimatedValue(level.toDouble()); 42 this.level = new AnimatedValue(level == null ? 0.0 : level.toDouble());
43 watch(this.level); 43 watch(this.level);
44 } 44 }
45 45
46 Widget child; 46 Widget child;
47 MaterialEdge edge; 47 MaterialEdge edge;
48 AnimatedValue level; 48 AnimatedValue level;
49 Color color; 49 Color color;
50 50
51 void syncFields(Material source) { 51 void syncFields(Material source) {
52 child = source.child; 52 child = source.child;
(...skipping 14 matching lines...) Expand all
67 boxShadow: _computeShadow(level.value), 67 boxShadow: _computeShadow(level.value),
68 borderRadius: edges[edge], 68 borderRadius: edges[edge],
69 backgroundColor: color, 69 backgroundColor: color,
70 shape: edge == MaterialEdge.circle ? Shape.circle : Shape.rectangle 70 shape: edge == MaterialEdge.circle ? Shape.circle : Shape.rectangle
71 ), 71 ),
72 child: new DefaultTextStyle(style: Theme.of(this).text.body1, child: child ) 72 child: new DefaultTextStyle(style: Theme.of(this).text.body1, child: child )
73 ); 73 );
74 } 74 }
75 75
76 } 76 }
OLDNEW
« no previous file with comments | « no previous file | sky/tests/examples/sector-expected.txt » ('j') | sky/tests/examples/sector-expected.txt » ('J')

Powered by Google App Engine
This is Rietveld 408576698