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

Unified Diff: sky/framework/animation/generator.dart

Issue 1005753002: Scrollable should settle back to 0.0 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 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/framework/components/ink_splash.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/framework/animation/generator.dart
diff --git a/sky/framework/animation/generator.dart b/sky/framework/animation/generator.dart
index 65c373f548a7029301c7b55d5f3ece344a7b6236..065d1e5f65601bc8ebb36364f4b27f99529569fb 100644
--- a/sky/framework/animation/generator.dart
+++ b/sky/framework/animation/generator.dart
@@ -61,14 +61,15 @@ class AnimationGenerator extends FrameGenerator {
Stream<double> _stream;
bool _done = false;
- AnimationGenerator(this.duration, {
+ AnimationGenerator({
this.initialDelay: 0.0,
+ this.duration,
this.begin: 0.0,
this.end: 1.0,
this.curve: linear,
Function onDone
}):super(onDone: onDone) {
- assert(duration > 0);
+ assert(duration != null && duration > 0.0);
double startTime = 0.0;
_stream = super.onTick.map((timeStamp) {
if (startTime == 0.0)
@@ -132,8 +133,12 @@ class Animation {
{ Curve curve: linear, double initialDelay: 0.0 }) {
stop();
- _animation = new AnimationGenerator(duration, begin: _value, end: newValue,
- curve: curve, initialDelay: initialDelay);
+ _animation = new AnimationGenerator(
+ duration: duration,
+ begin: _value,
+ end: newValue,
+ curve: curve,
+ initialDelay: initialDelay);
_animation.onTick.listen(_setValue, onDone: () {
_animation = null;
« no previous file with comments | « no previous file | sky/framework/components/ink_splash.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698