Delete AnimatedComponent

This class has no clients.
This commit is contained in:
Adam Barth 2015-10-05 17:35:51 -07:00
parent 012c5d94a1
commit 330af86bdc
2 changed files with 0 additions and 51 deletions

View File

@ -1,50 +0,0 @@
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:sky/animation.dart';
import 'package:sky/src/widgets/framework.dart';
abstract class AnimatedComponent extends StatefulComponent {
const AnimatedComponent({ Key key, this.direction, this.duration }) : super(key: key);
final Duration duration;
final AnimationDirection direction;
}
abstract class AnimatedState<T extends AnimatedComponent> extends State<T> {
void initState() {
super.initState();
_performance = new Performance(duration: config.duration);
performance.addStatusListener(_handleAnimationStatusChanged);
if (buildDependsOnPerformance) {
performance.addListener(() {
setState(() {
// We don't actually have any state to change, per se,
// we just know that we have in fact changed state.
});
});
}
performance.play(config.direction);
}
void didUpdateConfig(T oldConfig) {
performance.duration = config.duration;
if (config.duration != oldConfig.duration || config.direction != oldConfig.direction)
performance.play(config.direction);
}
Performance get performance => _performance;
Performance _performance;
void _handleAnimationStatusChanged(PerformanceStatus status) {
if (status == PerformanceStatus.completed)
handleCompleted();
else if (status == PerformanceStatus.dismissed)
handleDismissed();
}
bool get buildDependsOnPerformance => false;
void handleCompleted() { }
void handleDismissed() { }
}

View File

@ -5,7 +5,6 @@
/// The Flutter widget framework.
library widgets;
export 'src/widgets/animated_component.dart';
export 'src/widgets/animated_container.dart';
export 'src/widgets/app.dart';
export 'src/widgets/basic.dart';