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
3905d991
Unverified
Commit
3905d991
authored
Jan 09, 2018
by
Ian Hickson
Committed by
GitHub
Jan 09, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor doc improvements. (#13969)
parent
9114e2af
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
3 deletions
+41
-3
animation_controller.dart
packages/flutter/lib/src/animation/animation_controller.dart
+29
-1
ticker.dart
packages/flutter/lib/src/scheduler/ticker.dart
+12
-2
No files found.
packages/flutter/lib/src/animation/animation_controller.dart
View file @
3905d991
...
@@ -211,6 +211,15 @@ class AnimationController extends Animation<double>
...
@@ -211,6 +211,15 @@ class AnimationController extends Animation<double>
/// The most recently returned [TickerFuture], if any, is marked as having been
/// The most recently returned [TickerFuture], if any, is marked as having been
/// canceled, meaning the future never completes and its [TickerFuture.orCancel]
/// canceled, meaning the future never completes and its [TickerFuture.orCancel]
/// derivative future completes with a [TickerCanceled] error.
/// derivative future completes with a [TickerCanceled] error.
///
/// See also:
///
/// * [reset], which is equivalent to setting [value] to [lowerBound].
/// * [stop], which aborts the animation without changing its value or status
/// and without dispatching any notifications other than completing or
/// canceling the [TickerFuture].
/// * [forward], [reverse], [animateTo], [animateWith], [fling], and [repeat],
/// which start the animation controller.
set
value
(
double
newValue
)
{
set
value
(
double
newValue
)
{
assert
(
newValue
!=
null
);
assert
(
newValue
!=
null
);
stop
();
stop
();
...
@@ -221,6 +230,18 @@ class AnimationController extends Animation<double>
...
@@ -221,6 +230,18 @@ class AnimationController extends Animation<double>
/// Sets the controller's value to [lowerBound], stopping the animation (if
/// Sets the controller's value to [lowerBound], stopping the animation (if
/// in progress), and resetting to its beginning point, or dismissed state.
/// in progress), and resetting to its beginning point, or dismissed state.
///
/// The most recently returned [TickerFuture], if any, is marked as having been
/// canceled, meaning the future never completes and its [TickerFuture.orCancel]
/// derivative future completes with a [TickerCanceled] error.
///
/// See also:
///
/// * [value], which can be explicitly set to a specific value as desired.
/// * [forward], which starts the animation in the forward direction.
/// * [stop], which aborts the animation without changing its value or status
/// and without dispatching any notifications other than completing or
/// canceling the [TickerFuture].
void
reset
()
{
void
reset
()
{
value
=
lowerBound
;
value
=
lowerBound
;
}
}
...
@@ -463,8 +484,15 @@ class AnimationController extends Animation<double>
...
@@ -463,8 +484,15 @@ class AnimationController extends Animation<double>
/// By default, the most recently returned [TickerFuture] is marked as having
/// By default, the most recently returned [TickerFuture] is marked as having
/// been canceled, meaning the future never completes and its
/// been canceled, meaning the future never completes and its
/// [TickerFuture.orCancel] derivative future completes with a [TickerCanceled]
/// [TickerFuture.orCancel] derivative future completes with a [TickerCanceled]
/// error. By passing the `c
omplet
ed` argument with the value false, this is
/// error. By passing the `c
ancel
ed` argument with the value false, this is
/// reversed, and the futures complete successfully.
/// reversed, and the futures complete successfully.
///
/// See also:
///
/// * [reset], which stops the animation and resets it to the [lowerBound],
/// and which does send notifications.
/// * [forward], [reverse], [animateTo], [animateWith], [fling], and [repeat],
/// which restart the animation controller.
void
stop
({
bool
canceled:
true
})
{
void
stop
({
bool
canceled:
true
})
{
_simulation
=
null
;
_simulation
=
null
;
_lastElapsedDuration
=
null
;
_lastElapsedDuration
=
null
;
...
...
packages/flutter/lib/src/scheduler/ticker.dart
View file @
3905d991
...
@@ -346,7 +346,7 @@ class Ticker {
...
@@ -346,7 +346,7 @@ class Ticker {
/// if the [Ticker] that returned the [TickerFuture] was stopped with `canceled`
/// if the [Ticker] that returned the [TickerFuture] was stopped with `canceled`
/// set to true, or if it was disposed without being stopped.
/// set to true, or if it was disposed without being stopped.
///
///
/// To run a callback when either this future resolves or when the t
r
icker is
/// To run a callback when either this future resolves or when the ticker is
/// canceled, use [whenCompleteOrCancel].
/// canceled, use [whenCompleteOrCancel].
class
TickerFuture
implements
Future
<
Null
>
{
class
TickerFuture
implements
Future
<
Null
>
{
TickerFuture
.
_
();
TickerFuture
.
_
();
...
@@ -381,6 +381,10 @@ class TickerFuture implements Future<Null> {
...
@@ -381,6 +381,10 @@ class TickerFuture implements Future<Null> {
/// Calls `callback` either when this future resolves or when the ticker is
/// Calls `callback` either when this future resolves or when the ticker is
/// canceled.
/// canceled.
///
/// Calling this method registers an exception handler for the [orCancel]
/// future, so even if the [orCancel] property is accessed, canceling the
/// ticker will not cause an uncaught exception in the current zone.
void
whenCompleteOrCancel
(
VoidCallback
callback
)
{
void
whenCompleteOrCancel
(
VoidCallback
callback
)
{
Null
thunk
(
dynamic
value
)
{
Null
thunk
(
dynamic
value
)
{
callback
();
callback
();
...
@@ -391,6 +395,12 @@ class TickerFuture implements Future<Null> {
...
@@ -391,6 +395,12 @@ class TickerFuture implements Future<Null> {
/// A future that resolves when this future resolves or throws when the ticker
/// A future that resolves when this future resolves or throws when the ticker
/// is canceled.
/// is canceled.
///
/// If this property is never accessed, then canceling the ticker does not
/// throw any exceptions. Once this property is accessed, though, if the
/// corresponding ticker is canceled, then the [Future] returned by this
/// getter will complete with an error, and if that error is not caught, there
/// will be an uncaught exception in the current zone.
Future
<
Null
>
get
orCancel
{
Future
<
Null
>
get
orCancel
{
if
(
_secondaryCompleter
==
null
)
{
if
(
_secondaryCompleter
==
null
)
{
_secondaryCompleter
=
new
Completer
<
Null
>();
_secondaryCompleter
=
new
Completer
<
Null
>();
...
@@ -443,7 +453,7 @@ class TickerCanceled implements Exception {
...
@@ -443,7 +453,7 @@ class TickerCanceled implements Exception {
/// Reference to the [Ticker] object that was canceled.
/// Reference to the [Ticker] object that was canceled.
///
///
/// This may be null in the case that the [Future] created for
/// This may be null in the case that the [Future] created for
/// [TickerFuture.orCancel] was created after the
future
was canceled.
/// [TickerFuture.orCancel] was created after the
ticker
was canceled.
final
Ticker
ticker
;
final
Ticker
ticker
;
@override
@override
...
...
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