Introduce package:sky/animation.dart

Move the animation libraries into src/animation and change importers to use
package:sky/animation.dart. Also, move scheduler.dart into the animation
library so that the animation library can be self-contained.
This commit is contained in:
Adam Barth 2015-09-06 15:38:26 -07:00
parent b1ff22654e
commit ef880695d5
47 changed files with 193 additions and 234 deletions

View File

@ -5,6 +5,7 @@
library fitness;
import 'package:playfair/playfair.dart' as playfair;
import 'package:sky/animation.dart';
import 'package:sky/painting/text_style.dart';
import 'package:sky/theme/colors.dart' as colors;
import 'package:sky/widgets.dart';

View File

@ -4,7 +4,7 @@
import 'dart:sky' as sky;
import 'package:sky/base/scheduler.dart' as scheduler;
import 'package:sky/animation.dart';
import 'package:sky/rendering.dart';
import 'solid_color_box.dart';

View File

@ -9,6 +9,7 @@ import 'dart:sky' as sky;
import 'package:sky/theme/colors.dart' as colors;
import 'package:sky/theme/typography.dart' as typography;
import 'package:sky/animation.dart';
import 'package:sky/widgets.dart';
import 'stock_data.dart';

View File

@ -4,6 +4,7 @@
import 'package:sky/theme/colors.dart' as colors;
import 'package:sky/theme/typography.dart' as typography;
import 'package:sky/animation.dart';
import 'package:sky/widgets.dart';
class CardModel {

View File

@ -3,6 +3,7 @@
// found in the LICENSE file.
import 'package:sky/theme/colors.dart';
import 'package:sky/animation.dart';
import 'package:sky/widgets.dart';
class CardModel {

View File

@ -2,9 +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/animation_performance.dart';
import 'package:sky/animation/animated_value.dart';
import 'package:sky/animation/curves.dart';
import 'package:sky/animation.dart';
import 'package:sky/theme/colors.dart' as colors;
import 'package:sky/widgets.dart';

View File

@ -4,7 +4,7 @@
import 'dart:sky' as sky;
import 'package:sky/base/scheduler.dart' as scheduler;
import 'package:sky/animation.dart';
import 'package:sky/rendering.dart';
import 'package:sky/widgets.dart';

View File

@ -5,31 +5,30 @@ Sky and Sky's SDK are designed as layered frameworks, where each layer
depends on the ones below it but could be replaced wholesale.
The bottom-most layer is the Sky Platform, which is exposed to Dart
code as [various ```dart:``` packages](https://api.dartlang.org/),
including ```dart:sky```.
code as [various `dart:` packages](https://api.dartlang.org/),
including `dart:sky`.
The [base/](base/) directory contains libraries that extend these core
APIs to provide base classes for tree structures
([base/node.dart](base/node.dart)), hit testing
([base/hit_test.dart](base/hit_test.dart)), debugging
([base/debug.dart](base/debug.dart)), and task scheduling
([base/scheduler.dart](base/scheduler.dart)).
([base/hit_test.dart](base/hit_test.dart)), and debugging
([base/debug.dart](base/debug.dart)).
Above this are the files in the [animation/](animation/) directory,
which provide core primitives for animating values, and in the [gestures/](gestures/)
Above this layer is the [animation](animation.dart) library,
which provides core animation primitives, and the [gestures/](gestures/)
directory, which define a gesture recognition and disambiguation system.
The next layer consists of the files in the [painting/](painting/) directory,
which provide APIs related to drawing graphics. Some of the code here
uses the [animation/](animation/) utilities mentioned above.
uses the [animation](animation.dart) utilities mentioned above.
Layout primitives are provided in the next layer, found in the
[rendering/](rendering/) directory. They use ```dart:sky``` and the
APIs exposed in painting/ to provide a retained-mode layout and
[rendering](rendering.dart) library. They use `dart:sky` and the
APIs exposed in [painting/](painting/) to provide a retained-mode layout and
rendering model for applications or documents.
Widgets are provided by the files in the [widgets/](widgets/)
directory, using a reactive framework. They use data given in the
Widgets are provided by the files in the [widgets](widgets.dart)
library, using a reactive framework. They use data given in the
[theme/](theme/) directory to select styles consistent with Material
Design.
@ -38,18 +37,18 @@ anything that uses the Mojo IPC mechanism, typically as part of
wrapping host operating system features. Some of those Host APIs are
implemented in the host system's preferred language.
Here is a diagram summarising all this:
Here is a diagram summarizing all this:
+-----------------------------+ ------
| YOUR APP |
| +----------------------+---+
| | widgets/ (theme/) | |
| | widgets (theme/) | |
| ++---------------------++ |
| | rendering/ | | Dart
| | rendering | | Dart
| |---------+------------+ |
| | | painting/ | |
+-+ +------------+ |
| gestures/ | animation/ | |
| gestures/ | animation | |
+-----------+---+--------+ |
| base/ | mojo/ |
+------------+--+-+----+------+ -------

View File

@ -0,0 +1,19 @@
// 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.
/// The Sky animation engine.
///
/// This library includes and re-exports all Sky animation classes.
library animation;
export 'package:sky/src/rendering/auto_layout.dart';
export 'src/animation/animated_simulation.dart';
export 'src/animation/animated_value.dart';
export 'src/animation/animation_performance.dart';
export 'src/animation/curves.dart';
export 'src/animation/forces.dart';
export 'src/animation/scheduler.dart';
export 'src/animation/scroll_behavior.dart';
export 'src/animation/timeline.dart';

View File

@ -1,8 +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.
enum Direction {
forward,
reverse
}

View File

@ -40,6 +40,3 @@ const sky.Color debugPaintLayerBordersColor = const sky.Color(0xFFFF9800);
/// Causes RenderObjects to paint warnings when painting outside their bounds.
bool debugPaintBoundsEnabled = false;
/// Slows down animations by this factor to help in development.
double timeDilation = 1.0;

View File

@ -1,88 +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 'dart:collection';
import 'dart:sky' as sky;
import 'package:sky/base/debug.dart';
/// A callback from the scheduler
///
/// The timeStamp is the number of milliseconds since the beginning of the
/// scheduler's epoch. Use timeStamp to determine how far to advance animation
/// timelines so that all the animations in the system are synchronized to a
/// common time base.
typedef void SchedulerCallback(double timeStamp);
bool _haveScheduledVisualUpdate = false;
int _nextCallbackId = 1;
final List<SchedulerCallback> _persistentCallbacks = new List<SchedulerCallback>();
Map<int, SchedulerCallback> _transientCallbacks = new LinkedHashMap<int, SchedulerCallback>();
final Set<int> _removedIds = new Set<int>();
/// Called by the engine to produce a new frame.
///
/// This function first calls all the callbacks registered by
/// [requestAnimationFrame] and then calls all the callbacks registered by
/// [addPersistentFrameCallback], which typically drive the rendering pipeline.
void beginFrame(double timeStamp) {
timeStamp /= timeDilation;
_haveScheduledVisualUpdate = false;
Map<int, SchedulerCallback> callbacks = _transientCallbacks;
_transientCallbacks = new Map<int, SchedulerCallback>();
callbacks.forEach((id, callback) {
if (!_removedIds.contains(id))
callback(timeStamp);
});
_removedIds.clear();
for (SchedulerCallback callback in _persistentCallbacks)
callback(timeStamp);
}
/// Registers [beginFrame] callback with the engine.
void init() {
sky.view.setFrameCallback(beginFrame);
}
/// Call callback every frame.
void addPersistentFrameCallback(SchedulerCallback callback) {
_persistentCallbacks.add(callback);
}
/// Schedule a callback for the next frame.
///
/// The callback will be run prior to flushing the main rendering pipeline.
/// Typically, requestAnimationFrame is used to throttle writes into the
/// rendering pipeline until the system is ready to accept a new frame. For
/// example, if you wanted to tick through an animation, you should use
/// requestAnimation frame to determine when to tick the animation. The callback
/// is passed a timeStamp that you can use to determine how far along the
/// timeline to advance your animation.
///
/// Returns an id that can be used to unschedule this callback.
int requestAnimationFrame(SchedulerCallback callback) {
int id = _nextCallbackId++;
_transientCallbacks[id] = callback;
ensureVisualUpdate();
return id;
}
/// Cancel the callback identified by id.
void cancelAnimationFrame(int id) {
_transientCallbacks.remove(id);
_removedIds.add(id);
}
/// Ensure that a frame will be produced after this function is called.
void ensureVisualUpdate() {
if (_haveScheduledVisualUpdate)
return;
sky.view.scheduleFrame();
_haveScheduledVisualUpdate = true;
}

View File

@ -1,3 +1,3 @@
This directory contains painting-related libraries that only depend on
core Dart libraries, ../base/*, and ../animation/*. Note that
../animation/* depends on the Newton Dart library also.
core Dart libraries, `../base/*`, and [animation.dart](../animation.dart). Note
that [animation.dart](../animation.dart) depends on the Newton Dart library.

View File

@ -6,9 +6,7 @@ import 'dart:async';
import 'dart:sky' as sky;
import 'dart:sky' show Point, Offset, Color, Paint;
import 'package:sky/animation/animated_value.dart';
import 'package:sky/animation/animation_performance.dart';
import 'package:sky/animation/curves.dart';
import 'package:sky/animation.dart';
const Duration _kShowDuration = const Duration(milliseconds: 300);
const Duration _kHideDuration = const Duration(milliseconds: 200);

View File

@ -1,2 +1,2 @@
This directory contains animation-related libraries that only depend
on core Dart libraries, the Newton Dart library, and ../base/*.
on core Dart libraries and the Newton Dart library.

View File

@ -5,7 +5,7 @@
import 'dart:async';
import 'package:newton/newton.dart';
import 'package:sky/base/scheduler.dart' as scheduler;
import 'package:sky/src/animation/scheduler.dart';
const double _kSecondsPerMillisecond = 1000.0;

View File

@ -4,10 +4,12 @@
import "dart:sky";
import 'package:sky/animation/curves.dart';
import 'package:sky/animation/direction.dart';
import 'package:sky/src/animation/curves.dart';
export 'package:sky/animation/curves.dart' show Interval;
enum Direction {
forward,
reverse
}
abstract class AnimatedVariable {
void setProgress(double t, Direction direction);

View File

@ -4,12 +4,9 @@
import 'dart:async';
import 'package:sky/animation/animated_value.dart';
import 'package:sky/animation/direction.dart';
import 'package:sky/animation/forces.dart';
import 'package:sky/animation/timeline.dart';
export 'package:sky/animation/direction.dart' show Direction;
import 'package:sky/src/animation/animated_value.dart';
import 'package:sky/src/animation/forces.dart';
import 'package:sky/src/animation/timeline.dart';
enum AnimationStatus {
dismissed, // stoped at 0

View File

@ -39,22 +39,6 @@ class Interval implements Curve {
}
}
class ParabolicFall implements Curve {
const ParabolicFall();
double transform(double t) {
return -t*t + 1;
}
}
class ParabolicRise implements Curve {
const ParabolicRise();
double transform(double t) {
return -(t-1)*(t-1) + 1;
}
}
class Cubic implements Curve {
final double a;
final double b;
@ -162,8 +146,6 @@ const Cubic ease = const Cubic(0.25, 0.1, 0.25, 1.0);
const Cubic easeIn = const Cubic(0.42, 0.0, 1.0, 1.0);
const Cubic easeOut = const Cubic(0.0, 0.0, 0.58, 1.0);
const Cubic easeInOut = const Cubic(0.42, 0.0, 0.58, 1.0);
const ParabolicRise parabolicRise = const ParabolicRise();
const ParabolicFall parabolicFall = const ParabolicFall();
const BounceInCurve bounceIn = const BounceInCurve();
const BounceOutCurve bounceOut = const BounceOutCurve();
const BounceInOutCurve bounceInOut = const BounceInOutCurve();

View File

@ -6,22 +6,25 @@ import 'package:newton/newton.dart';
// Base class for creating Simulations for the animation Timeline.
abstract class Force {
const Force();
Simulation release(double position, double velocity);
}
class SpringForce extends Force {
SpringForce(this.spring, { this.left: 0.0, this.right: 1.0 });
const SpringForce(this.spring, { this.left: 0.0, this.right: 1.0 });
final SpringDescription spring;
// Where to put the spring's resting point when releasing left or right,
// respectively.
final double left, right;
final double left;
final double right;
// We overshoot the target by this distance, but stop the simulation when
// the spring gets within this distance (regardless of how fast it's moving).
// This causes the spring to settle a bit faster than it otherwise would.
static final Tolerance tolerance = new Tolerance(
static const Tolerance tolerance = const Tolerance(
velocity: double.INFINITY,
distance: 0.01
);

View File

@ -0,0 +1,95 @@
// 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 'dart:collection';
import 'dart:sky' as sky;
/// Slows down animations by this factor to help in development.
double timeDilation = 1.0;
/// A callback from the scheduler
///
/// The timeStamp is the number of milliseconds since the beginning of the
/// scheduler's epoch. Use timeStamp to determine how far to advance animation
/// timelines so that all the animations in the system are synchronized to a
/// common time base.
typedef void SchedulerCallback(double timeStamp);
/// Schedules callbacks to run in concert with the engine's animation system
class Scheduler {
/// Requires clients to use the [scheduler] singleton
Scheduler._() {
sky.view.setFrameCallback(beginFrame);
}
bool _haveScheduledVisualUpdate = false;
int _nextCallbackId = 1;
final List<SchedulerCallback> _persistentCallbacks = new List<SchedulerCallback>();
Map<int, SchedulerCallback> _transientCallbacks = new LinkedHashMap<int, SchedulerCallback>();
final Set<int> _removedIds = new Set<int>();
/// Called by the engine to produce a new frame.
///
/// This function first calls all the callbacks registered by
/// [requestAnimationFrame] and then calls all the callbacks registered by
/// [addPersistentFrameCallback], which typically drive the rendering pipeline.
void beginFrame(double timeStamp) {
timeStamp /= timeDilation;
_haveScheduledVisualUpdate = false;
Map<int, SchedulerCallback> callbacks = _transientCallbacks;
_transientCallbacks = new Map<int, SchedulerCallback>();
callbacks.forEach((id, callback) {
if (!_removedIds.contains(id))
callback(timeStamp);
});
_removedIds.clear();
for (SchedulerCallback callback in _persistentCallbacks)
callback(timeStamp);
}
/// Call callback every frame.
void addPersistentFrameCallback(SchedulerCallback callback) {
_persistentCallbacks.add(callback);
}
/// Schedule a callback for the next frame.
///
/// The callback will be run prior to flushing the main rendering pipeline.
/// Typically, requestAnimationFrame is used to throttle writes into the
/// rendering pipeline until the system is ready to accept a new frame. For
/// example, if you wanted to tick through an animation, you should use
/// requestAnimation frame to determine when to tick the animation. The callback
/// is passed a timeStamp that you can use to determine how far along the
/// timeline to advance your animation.
///
/// Returns an id that can be used to unschedule this callback.
int requestAnimationFrame(SchedulerCallback callback) {
int id = _nextCallbackId++;
_transientCallbacks[id] = callback;
ensureVisualUpdate();
return id;
}
/// Cancel the callback identified by id.
void cancelAnimationFrame(int id) {
_transientCallbacks.remove(id);
_removedIds.add(id);
}
/// Ensure that a frame will be produced after this function is called.
void ensureVisualUpdate() {
if (_haveScheduledVisualUpdate)
return;
sky.view.scheduleFrame();
_haveScheduledVisualUpdate = true;
}
}
/// A singleton instance of Scheduler to coordinate all the callbacks.
final Scheduler scheduler = new Scheduler._();

View File

@ -5,7 +5,8 @@
import 'dart:async';
import 'package:newton/newton.dart';
import 'package:sky/animation/animated_simulation.dart';
import 'package:sky/src/animation/animated_simulation.dart';
// Simple simulation that linearly varies from |begin| to |end| over |duration|.
class TweenSimulation extends Simulation {

View File

@ -372,8 +372,8 @@ This can be quite useful in figuring out exactly what is going on when
working with the render tree.
```dart
import 'package:sky/src/rendering/sky_binding.dart';
import 'package:sky/base/scheduler.dart' as scheduler;
import 'package:sky/animation.dart';
import 'package:sky/rendering.dart';
scheduler.addPersistentFrameCallback((_) {
SkyBinding.instance.debugDumpRenderTree();
@ -384,6 +384,6 @@ scheduler.addPersistentFrameCallback((_) {
Dependencies
------------
* [`package:sky/base`](../base)
* [`package:sky/mojo`](../mojo)
* [`package:sky/animation`](../mojo)
* [`package:sky/base`](../../base)
* [`package:sky/mojo`](../../mojo)
* [`package:sky/animation.dart`](../../animation.dart)

View File

@ -6,10 +6,10 @@ import 'dart:math' as math;
import 'dart:sky' as sky;
import 'dart:sky' show Point, Offset, Size, Rect, Color, Paint, Path;
import 'package:sky/animation.dart';
import 'package:sky/base/debug.dart';
import 'package:sky/base/hit_test.dart';
import 'package:sky/base/node.dart';
import 'package:sky/base/scheduler.dart' as scheduler;
import 'package:sky/src/rendering/layer.dart';
import 'package:vector_math/vector_math.dart';

View File

@ -4,9 +4,9 @@
import 'dart:sky' as sky;
import 'package:sky/base/pointer_router.dart';
import 'package:sky/animation.dart';
import 'package:sky/base/hit_test.dart';
import 'package:sky/base/scheduler.dart' as scheduler;
import 'package:sky/base/pointer_router.dart';
import 'package:sky/gestures/arena.dart';
import 'package:sky/src/rendering/box.dart';
import 'package:sky/src/rendering/object.dart';
@ -45,7 +45,6 @@ class SkyBinding extends HitTestTarget {
sky.view.setEventCallback(_handleEvent);
sky.view.setMetricsChangedCallback(_handleMetricsChanged);
scheduler.init();
if (renderViewOverride == null) {
_renderView = new RenderView(child: root);
_renderView.attach();

View File

@ -4,9 +4,7 @@
import 'dart:sky' as sky;
import 'package:sky/animation/animated_value.dart';
import 'package:sky/animation/animation_performance.dart';
import 'package:sky/animation/curves.dart';
import 'package:sky/animation.dart';
import 'package:sky/src/rendering/box.dart';
import 'package:sky/src/rendering/object.dart';
import 'package:sky/src/rendering/proxy_box.dart';

View File

@ -4,7 +4,7 @@
import 'dart:sky' as sky;
import 'package:sky/base/scheduler.dart' as scheduler;
import 'package:sky/animation.dart';
import 'package:sky/src/rendering/layer.dart';
import 'package:sky/src/rendering/object.dart';
import 'package:sky/src/rendering/box.dart';

View File

@ -500,8 +500,8 @@ Dependencies
------------
* `package:vector_math`
* [`package:sky/animation`](../animation)
* [`package:sky/base`](../base)
* [`package:sky/painting`](../painting)
* [`package:sky/rendering`](../rendering)
* [`package:sky/theme`](../theme)
* [`package:sky/animation.dart`](../../animation.dart)
* [`package:sky/base`](../../base)
* [`package:sky/painting`](../../painting)
* [`package:sky/rendering.dart`](../../rendering.dart)
* [`package:sky/theme`](../../theme)

View File

@ -2,7 +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/animation_performance.dart';
import 'package:sky/animation.dart';
import 'package:sky/src/widgets/framework.dart';
abstract class AnimatedComponent extends StatefulComponent {

View File

@ -5,9 +5,7 @@
import 'dart:sky' as sky;
import 'package:vector_math/vector_math.dart';
import 'package:sky/animation/animated_value.dart';
import 'package:sky/animation/animation_performance.dart';
import 'package:sky/animation/curves.dart';
import 'package:sky/animation.dart';
import 'package:sky/painting/box_painter.dart';
import 'package:sky/src/widgets/animated_component.dart';
import 'package:sky/src/widgets/basic.dart';

View File

@ -4,8 +4,7 @@
import 'dart:async';
import 'package:sky/animation/animated_value.dart';
import 'package:sky/animation/curves.dart';
import 'package:sky/animation.dart';
import 'package:sky/theme/colors.dart' as colors;
import 'package:sky/src/widgets/basic.dart';
import 'package:sky/src/widgets/default_text_style.dart';

View File

@ -4,9 +4,7 @@
import 'dart:sky' as sky;
import 'package:sky/animation/animated_value.dart';
import 'package:sky/animation/animation_performance.dart';
import 'package:sky/animation/curves.dart';
import 'package:sky/animation.dart';
import 'package:sky/src/widgets/basic.dart';
import 'package:sky/src/widgets/transitions.dart';
import 'package:sky/src/widgets/framework.dart';

View File

@ -5,9 +5,7 @@
import 'dart:async';
import 'dart:sky' as sky;
import 'package:sky/animation/animated_value.dart';
import 'package:sky/animation/animation_performance.dart';
import 'package:sky/animation/forces.dart';
import 'package:sky/animation.dart';
import 'package:sky/theme/colors.dart' as colors;
import 'package:sky/theme/shadows.dart';
import 'package:sky/src/widgets/animated_container.dart';
@ -19,8 +17,6 @@ import 'package:sky/src/widgets/scrollable.dart';
import 'package:sky/src/widgets/theme.dart';
import 'package:sky/src/widgets/transitions.dart';
export 'package:sky/animation/animation_performance.dart' show AnimationStatus;
// TODO(eseidel): Draw width should vary based on device size:
// http://www.google.com/design/spec/layout/structure.html#structure-side-nav

View File

@ -6,8 +6,8 @@ import 'dart:async';
import 'dart:collection';
import 'dart:sky' as sky;
import 'package:sky/animation.dart';
import 'package:sky/base/hit_test.dart';
import 'package:sky/base/scheduler.dart' as scheduler;
import 'package:sky/mojo/activity.dart';
import 'package:sky/src/rendering/box.dart';
import 'package:sky/src/rendering/object.dart';

View File

@ -5,12 +5,8 @@
import 'dart:math' as math;
import 'dart:sky' as sky;
import 'package:sky/animation/animated_value.dart';
import 'package:sky/animation/animation_performance.dart';
import 'package:sky/animation/curves.dart';
import 'package:sky/src/rendering/box.dart';
import 'package:sky/src/rendering/object.dart';
import 'package:sky/src/rendering/proxy_box.dart';
import 'package:sky/animation.dart';
import 'package:sky/rendering.dart';
import 'package:sky/src/widgets/basic.dart';
import 'package:sky/src/widgets/framework.dart';

View File

@ -2,9 +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/animation/curves.dart';
import 'package:sky/animation.dart';
import 'package:sky/src/widgets/animated_component.dart';
import 'package:sky/src/widgets/basic.dart';
import 'package:sky/src/widgets/framework.dart';

View File

@ -2,9 +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/animation/curves.dart';
import 'package:sky/animation.dart';
import 'package:sky/src/widgets/basic.dart';
import 'package:sky/src/widgets/focus.dart';
import 'package:sky/src/widgets/framework.dart';

View File

@ -4,8 +4,7 @@
import 'dart:sky' as sky;
import 'package:sky/animation/animated_value.dart';
import 'package:sky/animation/animation_performance.dart';
import 'package:sky/animation.dart';
import 'package:sky/painting/box_painter.dart';
import 'package:sky/theme/colors.dart';
import 'package:sky/theme/shadows.dart';
@ -16,8 +15,6 @@ import 'package:sky/src/widgets/popup_menu_item.dart';
import 'package:sky/src/widgets/scrollable.dart';
import 'package:sky/src/widgets/transitions.dart';
export 'package:sky/animation/animation_performance.dart' show AnimationStatus;
const Duration _kMenuDuration = const Duration(milliseconds: 300);
double _kMenuCloseIntervalEnd = 2.0 / 3.0;
const double _kMenuWidthStep = 56.0;

View File

@ -5,9 +5,7 @@
import 'dart:math' as math;
import 'dart:sky' as sky;
import 'package:sky/animation/animation_performance.dart';
import 'package:sky/animation/animated_value.dart';
import 'package:sky/animation/curves.dart';
import 'package:sky/animation.dart';
import 'package:sky/src/widgets/basic.dart';
import 'package:sky/src/widgets/theme.dart';
import 'package:sky/src/widgets/framework.dart';

View File

@ -7,11 +7,7 @@ import 'dart:math' as math;
import 'dart:sky' as sky;
import 'package:newton/newton.dart';
import 'package:sky/animation/animated_simulation.dart';
import 'package:sky/animation/animated_value.dart';
import 'package:sky/animation/animation_performance.dart';
import 'package:sky/animation/curves.dart';
import 'package:sky/animation/scroll_behavior.dart';
import 'package:sky/animation.dart';
import 'package:sky/gestures/constants.dart';
import 'package:sky/src/rendering/box.dart';
import 'package:sky/src/rendering/viewport.dart';

View File

@ -3,9 +3,7 @@
// found in the LICENSE file.
import 'package:sky/animation/animated_value.dart';
import 'package:sky/animation/animation_performance.dart';
import 'package:sky/animation/curves.dart';
import 'package:sky/animation.dart';
import 'package:sky/painting/text_style.dart';
import 'package:sky/theme/typography.dart' as typography;
import 'package:sky/src/widgets/basic.dart';
@ -16,8 +14,6 @@ import 'package:sky/src/widgets/material.dart';
import 'package:sky/src/widgets/theme.dart';
import 'package:sky/src/widgets/transitions.dart';
export 'package:sky/animation/animation_performance.dart' show AnimationStatus;
typedef void SnackBarDismissedCallback();
const Duration _kSlideInDuration = const Duration(milliseconds: 200);

View File

@ -6,14 +6,9 @@ import 'dart:math' as math;
import 'dart:sky' as sky;
import 'package:newton/newton.dart';
import 'package:sky/animation/animation_performance.dart';
import 'package:sky/animation/animated_value.dart';
import 'package:sky/animation/curves.dart';
import 'package:sky/animation/scroll_behavior.dart';
import 'package:sky/animation.dart';
import 'package:sky/painting/text_style.dart';
import 'package:sky/src/rendering/box.dart';
import 'package:sky/src/rendering/object.dart';
import 'package:sky/src/rendering/viewport.dart';
import 'package:sky/rendering.dart';
import 'package:sky/theme/colors.dart' as colors;
import 'package:sky/theme/typography.dart' as typography;
import 'package:sky/src/widgets/basic.dart';

View File

@ -2,14 +2,13 @@
// 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/animation.dart';
import 'package:sky/src/widgets/animated_component.dart';
import 'package:sky/src/widgets/basic.dart';
import 'package:sky/src/widgets/framework.dart';
import 'package:vector_math/vector_math.dart';
export 'package:sky/animation/direction.dart' show Direction;
export 'package:sky/animation.dart' show Direction;
// A helper class to anchor widgets to one another. Pass an instance of this to
// a Transition, then use the build() method to create a child with the same

View File

@ -1,4 +1,4 @@
import 'package:sky/base/scheduler.dart' as scheduler;
import 'package:sky/animation.dart';
import 'package:test/test.dart';
void main() {

View File

@ -1,8 +1,8 @@
import 'dart:sky' as sky;
import 'package:sky/animation.dart';
import 'package:sky/rendering.dart';
import 'package:sky/widgets.dart';
import 'package:sky/base/scheduler.dart' as scheduler;
import '../engine/mock_events.dart';

View File

@ -11,8 +11,7 @@ import 'dart:typed_data';
import 'dart:sky';
import 'package:mojo/core.dart';
import 'package:sky/animation/curves.dart';
import 'package:sky/base/scheduler.dart' as scheduler;
import 'package:sky/animation.dart';
import 'package:sky/mojo/asset_bundle.dart';
import 'package:sky/mojo/shell.dart' as shell;
import 'package:sky/painting/text_painter.dart';