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

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

Issue 1224223004: Fix test failures from AnimatedContainer 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sky/sdk/lib/widgets/material.dart » ('j') | sky/sdk/lib/widgets/material.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/lib/widgets/animated_container.dart
diff --git a/sky/sdk/lib/widgets/animated_container.dart b/sky/sdk/lib/widgets/animated_container.dart
index 1c8739fc6f644353d79d76510e133a13bd8589bb..dc6861cca683879d26c28bca2d27fe79c50353c9 100644
--- a/sky/sdk/lib/widgets/animated_container.dart
+++ b/sky/sdk/lib/widgets/animated_container.dart
@@ -21,6 +21,10 @@ class AnimatedContainer {
AnimatedType<double> shadow;
AnimatedColor backgroundColor;
+ // These don't animate, but are used to build the Container anyway.
+ double borderRadius;
+ Shape shape;
+
Map<AnimatedVariable, AnimationPerformance> _variableToPerformance =
new Map<AnimatedVariable, AnimationPerformance>();
@@ -37,9 +41,12 @@ class AnimatedContainer {
Widget build(Widget child) {
Widget current = child;
- if (shadow != null || backgroundColor != null) {
+ if (shadow != null || backgroundColor != null ||
+ borderRadius != null || shape != null) {
current = new DecoratedBox(
decoration: new BoxDecoration(
+ borderRadius: borderRadius,
+ shape: shape,
boxShadow: shadow != null ? _computeShadow(shadow.value) : null,
backgroundColor: backgroundColor != null ? backgroundColor.value : null),
child: current);
@@ -58,6 +65,9 @@ class AnimatedContainer {
_syncField(position, source.position);
_syncField(shadow, source.shadow);
_syncField(backgroundColor, source.backgroundColor);
+
+ borderRadius = source.borderRadius;
+ shape = source.shape;
}
void _syncField(AnimatedType variable, AnimatedType sourceVariable) {
« no previous file with comments | « no previous file | sky/sdk/lib/widgets/material.dart » ('j') | sky/sdk/lib/widgets/material.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698