Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
25b80399
Commit
25b80399
authored
Sep 08, 2015
by
Adam Barth
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1076 from abarth/docs_animation
Introduce package:sky/animation.dart
parents
0a37e06b
b356d146
Changes
47
Hide whitespace changes
Inline
Side-by-side
Showing
47 changed files
with
193 additions
and
234 deletions
+193
-234
main.dart
examples/fitness/lib/main.dart
+1
-0
spinning_flex.dart
examples/rendering/spinning_flex.dart
+1
-1
main.dart
examples/stocks/lib/main.dart
+1
-0
card_collection.dart
examples/widgets/card_collection.dart
+1
-0
pageable_list.dart
examples/widgets/pageable_list.dart
+1
-0
progress_indicator.dart
examples/widgets/progress_indicator.dart
+1
-3
spinning_mixed.dart
examples/widgets/spinning_mixed.dart
+1
-1
README.md
packages/flutter/lib/README.md
+15
-16
animation.dart
packages/flutter/lib/animation.dart
+19
-0
direction.dart
packages/flutter/lib/animation/direction.dart
+0
-8
debug.dart
packages/flutter/lib/base/debug.dart
+0
-3
scheduler.dart
packages/flutter/lib/base/scheduler.dart
+0
-88
README.md
packages/flutter/lib/painting/README.md
+2
-2
radial_reaction.dart
packages/flutter/lib/painting/radial_reaction.dart
+1
-3
README.md
packages/flutter/lib/src/animation/README.md
+1
-1
animated_simulation.dart
packages/flutter/lib/src/animation/animated_simulation.dart
+1
-1
animated_value.dart
packages/flutter/lib/src/animation/animated_value.dart
+5
-3
animation_performance.dart
...ages/flutter/lib/src/animation/animation_performance.dart
+3
-6
curves.dart
packages/flutter/lib/src/animation/curves.dart
+0
-18
forces.dart
packages/flutter/lib/src/animation/forces.dart
+6
-3
scheduler.dart
packages/flutter/lib/src/animation/scheduler.dart
+95
-0
scroll_behavior.dart
packages/flutter/lib/src/animation/scroll_behavior.dart
+0
-0
timeline.dart
packages/flutter/lib/src/animation/timeline.dart
+2
-1
README.md
packages/flutter/lib/src/rendering/README.md
+5
-5
object.dart
packages/flutter/lib/src/rendering/object.dart
+1
-1
sky_binding.dart
packages/flutter/lib/src/rendering/sky_binding.dart
+2
-3
toggleable.dart
packages/flutter/lib/src/rendering/toggleable.dart
+1
-3
view.dart
packages/flutter/lib/src/rendering/view.dart
+1
-1
README.md
packages/flutter/lib/src/widgets/README.md
+5
-5
animated_component.dart
packages/flutter/lib/src/widgets/animated_component.dart
+1
-1
animated_container.dart
packages/flutter/lib/src/widgets/animated_container.dart
+1
-3
dialog.dart
packages/flutter/lib/src/widgets/dialog.dart
+1
-2
dismissable.dart
packages/flutter/lib/src/widgets/dismissable.dart
+1
-3
drawer.dart
packages/flutter/lib/src/widgets/drawer.dart
+1
-5
framework.dart
packages/flutter/lib/src/widgets/framework.dart
+1
-1
ink_well.dart
packages/flutter/lib/src/widgets/ink_well.dart
+2
-6
mimic_overlay.dart
packages/flutter/lib/src/widgets/mimic_overlay.dart
+1
-3
navigator.dart
packages/flutter/lib/src/widgets/navigator.dart
+1
-3
popup_menu.dart
packages/flutter/lib/src/widgets/popup_menu.dart
+1
-4
progress_indicator.dart
packages/flutter/lib/src/widgets/progress_indicator.dart
+1
-3
scrollable.dart
packages/flutter/lib/src/widgets/scrollable.dart
+1
-5
snack_bar.dart
packages/flutter/lib/src/widgets/snack_bar.dart
+1
-5
tabs.dart
packages/flutter/lib/src/widgets/tabs.dart
+2
-7
transitions.dart
packages/flutter/lib/src/widgets/transitions.dart
+2
-3
skysprites.dart
packages/flutter_sprites/lib/skysprites.dart
+1
-2
scheduler_test.dart
packages/unit/test/animation/scheduler_test.dart
+1
-1
widget_tester.dart
packages/unit/test/widget/widget_tester.dart
+1
-1
No files found.
examples/fitness/lib/main.dart
View file @
25b80399
...
...
@@ -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'
;
...
...
examples/rendering/spinning_flex.dart
View file @
25b80399
...
...
@@ -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'
;
...
...
examples/stocks/lib/main.dart
View file @
25b80399
...
...
@@ -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'
;
...
...
examples/widgets/card_collection.dart
View file @
25b80399
...
...
@@ -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
{
...
...
examples/widgets/pageable_list.dart
View file @
25b80399
...
...
@@ -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
{
...
...
examples/widgets/progress_indicator.dart
View file @
25b80399
...
...
@@ -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'
;
...
...
examples/widgets/spinning_mixed.dart
View file @
25b80399
...
...
@@ -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'
;
...
...
packages/flutter/lib/README.md
View file @
25b80399
...
...
@@ -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/
)
directo
ry,
which provide
core primitives for animating values, and in
the
[
gestures/
](
gestures/
)
Above this
layer is the
[
animation
](
animation.dart
)
libra
ry,
which provide
s 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/
)
directo
ry, using a reactive framework. They use data given in the
Widgets are provided by the files in the
[
widgets
](
widgets.dart
)
libra
ry, 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 summari
s
ing all this:
Here is a diagram summari
z
ing all this:
+-----------------------------+ ------
| YOUR APP |
| +----------------------+---+
| | widgets
/
(theme/) | |
| | widgets
(theme/) | |
| ++---------------------++ |
| | rendering
/
| | Dart
| | rendering
| | Dart
| |---------+------------+ |
| | | painting/ | |
+-+ +------------+ |
| gestures/ | animation
/
| |
| gestures/ | animation
| |
+-----------+---+--------+ |
| base/ | mojo/ |
+------------+--+-+----+------+ -------
...
...
packages/flutter/lib/animation.dart
0 → 100644
View file @
25b80399
// 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'
;
packages/flutter/lib/animation/direction.dart
deleted
100644 → 0
View file @
0a37e06b
// 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
}
packages/flutter/lib/base/debug.dart
View file @
25b80399
...
...
@@ -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
;
packages/flutter/lib/base/scheduler.dart
deleted
100644 → 0
View file @
0a37e06b
// 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
;
}
packages/flutter/lib/painting/README.md
View file @
25b80399
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
.
packages/flutter/lib/painting/radial_reaction.dart
View file @
25b80399
...
...
@@ -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
);
...
...
packages/flutter/lib/animation/README.md
→
packages/flutter/lib/
src/
animation/README.md
View file @
25b80399
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
.
packages/flutter/lib/animation/animated_simulation.dart
→
packages/flutter/lib/
src/
animation/animated_simulation.dart
View file @
25b80399
...
...
@@ -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
;
...
...
packages/flutter/lib/animation/animated_value.dart
→
packages/flutter/lib/
src/
animation/animated_value.dart
View file @
25b80399
...
...
@@ -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
);
...
...
packages/flutter/lib/animation/animation_performance.dart
→
packages/flutter/lib/
src/
animation/animation_performance.dart
View file @
25b80399
...
...
@@ -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
...
...
packages/flutter/lib/animation/curves.dart
→
packages/flutter/lib/
src/
animation/curves.dart
View file @
25b80399
...
...
@@ -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
();
...
...
packages/flutter/lib/animation/forces.dart
→
packages/flutter/lib/
src/
animation/forces.dart
View file @
25b80399
...
...
@@ -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
);
...
...
packages/flutter/lib/src/animation/scheduler.dart
0 → 100644
View file @
25b80399
// 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
.
_
();
packages/flutter/lib/animation/scroll_behavior.dart
→
packages/flutter/lib/
src/
animation/scroll_behavior.dart
View file @
25b80399
File moved
packages/flutter/lib/animation/timeline.dart
→
packages/flutter/lib/
src/
animation/timeline.dart
View file @
25b80399
...
...
@@ -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
{
...
...
packages/flutter/lib/src/rendering/README.md
View file @
25b80399
...
...
@@ -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
)
packages/flutter/lib/src/rendering/object.dart
View file @
25b80399
...
...
@@ -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'
;
...
...
packages/flutter/lib/src/rendering/sky_binding.dart
View file @
25b80399
...
...
@@ -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
();
...
...
packages/flutter/lib/src/rendering/toggleable.dart
View file @
25b80399
...
...
@@ -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'
;
...
...
packages/flutter/lib/src/rendering/view.dart
View file @
25b80399
...
...
@@ -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'
;
...
...
packages/flutter/lib/src/widgets/README.md
View file @
25b80399
...
...
@@ -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
)
packages/flutter/lib/src/widgets/animated_component.dart
View file @
25b80399
...
...
@@ -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
{
...
...
packages/flutter/lib/src/widgets/animated_container.dart
View file @
25b80399
...
...
@@ -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'
;
...
...
packages/flutter/lib/src/widgets/dialog.dart
View file @
25b80399
...
...
@@ -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'
;
...
...
packages/flutter/lib/src/widgets/dismissable.dart
View file @
25b80399
...
...
@@ -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'
;
...
...
packages/flutter/lib/src/widgets/drawer.dart
View file @
25b80399
...
...
@@ -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
...
...
packages/flutter/lib/src/widgets/framework.dart
View file @
25b80399
...
...
@@ -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'
;
...
...
packages/flutter/lib/src/widgets/ink_well.dart
View file @
25b80399
...
...
@@ -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'
;
...
...
packages/flutter/lib/src/widgets/mimic_overlay.dart
View file @
25b80399
...
...
@@ -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'
;
...
...
packages/flutter/lib/src/widgets/navigator.dart
View file @
25b80399
...
...
@@ -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'
;
...
...
packages/flutter/lib/src/widgets/popup_menu.dart
View file @
25b80399
...
...
@@ -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
;
...
...
packages/flutter/lib/src/widgets/progress_indicator.dart
View file @
25b80399
...
...
@@ -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'
;
...
...
packages/flutter/lib/src/widgets/scrollable.dart
View file @
25b80399
...
...
@@ -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'
;
...
...
packages/flutter/lib/src/widgets/snack_bar.dart
View file @
25b80399
...
...
@@ -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
);
...
...
packages/flutter/lib/src/widgets/tabs.dart
View file @
25b80399
...
...
@@ -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'
;
...
...
packages/flutter/lib/src/widgets/transitions.dart
View file @
25b80399
...
...
@@ -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
...
...
packages/flutter_sprites/lib/skysprites.dart
View file @
25b80399
...
...
@@ -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'
;
...
...
packages/unit/test/
base
/scheduler_test.dart
→
packages/unit/test/
animation
/scheduler_test.dart
View file @
25b80399
import
'package:sky/
base/scheduler.dart'
as
scheduler
;
import
'package:sky/
animation.dart'
;
import
'package:test/test.dart'
;
void
main
(
)
{
...
...
packages/unit/test/widget/widget_tester.dart
View file @
25b80399
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'
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment