Commit b31e06a5 authored by Matt Perry's avatar Matt Perry

Make SnackBar animate itself.

parent 839e997e
......@@ -51,8 +51,8 @@ class StockHome extends StatefulComponent {
bool _isSearching = false;
String _searchQuery;
SnackBarStatus _snackBarStatus;
bool _isSnackBarShowing = false; // Should it be showing?
SnackBarStatus _snackBarStatus = SnackBarStatus.inactive;
bool _isSnackBarShowing = false;
void _handleSearchBegin() {
navigator.pushState(this, (_) {
......
......@@ -46,16 +46,6 @@ enum DrawerStatus {
typedef void DrawerStatusChangedCallback(DrawerStatus status);
// TODO(mpcomplete): find a better place for this.
class AnimatedColor extends AnimatedType<Color> {
AnimatedColor(Color begin, { Color end, Curve curve: linear })
: super(begin, end: end, curve: curve);
void setFraction(double t) {
value = lerpColor(begin, end, t);
}
}
class Drawer extends AnimatedComponent {
Drawer({
String key,
......
......@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:sky/animation/animated_value.dart';
import 'package:sky/animation/animation_performance.dart';
import 'package:sky/painting/text_style.dart';
import 'package:sky/theme/typography.dart' as typography;
......@@ -69,11 +70,11 @@ class SnackBar extends AnimatedComponent {
}
}
AnimatedType<Point> _position;
AnimatedValue<Point> _position;
AnimationPerformance _performance;
void initState() {
_position = new AnimatedType<Point>(new Point(0.0, 50.0), end: Point.origin);
_position = new AnimatedValue<Point>(new Point(0.0, 50.0), end: Point.origin);
_performance = new AnimationPerformance()
..duration = _kSlideInDuration
..variable = _position
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment