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
80ab0f64
Commit
80ab0f64
authored
Mar 17, 2017
by
Michael Goderbauer
Committed by
GitHub
Mar 17, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove addFrameCallback (#8874)
Fixes #7793.
parent
808cd092
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
39 deletions
+8
-39
binding.dart
packages/flutter/lib/src/scheduler/binding.dart
+7
-38
binding.dart
packages/flutter/lib/src/widgets/binding.dart
+1
-1
No files found.
packages/flutter/lib/src/scheduler/binding.dart
View file @
80ab0f64
...
...
@@ -63,7 +63,7 @@ class _FrameCallbackEntry {
assert
(()
{
if
(
debugCurrentCallbackStack
==
null
)
{
throw
new
FlutterError
(
'
addFrameCallback or
scheduleFrameCallback called with rescheduling true, but no callback is in scope.
\n
'
'scheduleFrameCallback called with rescheduling true, but no callback is in scope.
\n
'
'The "rescheduling" argument should only be set to true if the '
'callback is being reregistered from within the callback itself, '
'and only then if the callback itself is entirely synchronous. '
...
...
@@ -108,8 +108,7 @@ enum SchedulerPhase {
idle
,
/// The transient callbacks (scheduled by
/// [WidgetsBinding.scheduleFrameCallback] and
/// [WidgetsBinding.addFrameCallback]) are currently executing.
/// [WidgetsBinding.scheduleFrameCallback]) are currently executing.
///
/// Typically, these callbacks handle updating objects to new animation states.
transientCallbacks
,
...
...
@@ -262,36 +261,7 @@ abstract class SchedulerBinding extends BindingBase {
/// [cancelFrameCallbackWithId].
int
scheduleFrameCallback
(
FrameCallback
callback
,
{
bool
rescheduling:
false
})
{
scheduleFrame
();
return
addFrameCallback
(
callback
,
rescheduling:
rescheduling
);
}
/// Adds a transient frame callback.
///
/// Frame callbacks are executed at the beginning of a frame (see
/// [handleBeginFrame]).
///
/// These callbacks are executed in the order in which they have
/// been added.
///
/// Callbacks registered with this method will not be called until
/// a frame is requested. To register a callback and ensure that a
/// frame is immediately scheduled, use [scheduleFrameCallback].
///
/// If this is a one-off registration, ignore the `rescheduling` argument.
///
/// If this is a callback that will be reregistered each time it fires, then
/// when you reregister the callback, set the `rescheduling` argument to true.
/// This has no effect in release builds, but in debug builds, it ensures that
/// the stack trace that is stored for this callback is the original stack
/// trace for when the callback was _first_ registered, rather than the stack
/// trace for when the callback is reregistered. This makes it easier to track
/// down the original reason that a particular callback was called. If
/// `rescheduling` is true, the call must be in the context of a frame
/// callback.
///
/// Callbacks registered with this method can be canceled using
/// [cancelFrameCallbackWithId].
int
addFrameCallback
(
FrameCallback
callback
,
{
bool
rescheduling:
false
})
{
_nextFrameCallbackId
+=
1
;
_transientCallbacks
[
_nextFrameCallbackId
]
=
new
_FrameCallbackEntry
(
callback
,
rescheduling:
rescheduling
);
return
_nextFrameCallbackId
;
...
...
@@ -303,7 +273,7 @@ abstract class SchedulerBinding extends BindingBase {
/// has been requested, this does not also cancel that request.
///
/// Transient frame callbacks are those registered using
/// [scheduleFrameCallback]
or [addFrameCallback]
.
/// [scheduleFrameCallback].
void
cancelFrameCallbackWithId
(
int
id
)
{
assert
(
id
>
0
);
_transientCallbacks
.
remove
(
id
);
...
...
@@ -314,7 +284,7 @@ abstract class SchedulerBinding extends BindingBase {
/// there are, prints their locations and throws an exception.
///
/// A transient frame callback is one that was registered with
/// [scheduleFrameCallback]
or [addFrameCallback]
.
/// [scheduleFrameCallback].
///
/// This is expected to be called at the end of tests (the
/// flutter_test framework does it automatically in normal cases).
...
...
@@ -369,12 +339,11 @@ abstract class SchedulerBinding extends BindingBase {
/// Prints the stack for where the current transient callback was registered.
///
/// A transient frame callback is one that was registered with
/// [scheduleFrameCallback]
or [addFrameCallback]
.
/// [scheduleFrameCallback].
///
/// When called in debug more and in the context of a transient callback, this
/// function prints the stack trace from where the current transient callback
/// was registered (i.e. where it first called addFrameCallback or
/// scheduleFrameCallback).
/// was registered (i.e. where it first called [scheduleFrameCallback]).
///
/// When called in debug mode in other contexts, it prints a message saying
/// that this function was not called in the context a transient callback.
...
...
@@ -552,7 +521,7 @@ abstract class SchedulerBinding extends BindingBase {
/// Called by the engine to produce a new frame.
///
/// This function first calls all the callbacks registered by
/// [scheduleFrameCallback]
/[addFrameCallback]
, then calls all the callbacks
/// [scheduleFrameCallback], then calls all the callbacks
/// registered by [addPersistentFrameCallback], which typically drive the
/// rendering pipeline, and finally calls the callbacks registered by
/// [addPostFrameCallback].
...
...
packages/flutter/lib/src/widgets/binding.dart
View file @
80ab0f64
...
...
@@ -285,7 +285,7 @@ abstract class WidgetsBinding extends BindingBase implements GestureBinding, Ren
///
/// 1. The animation phase: The [handleBeginFrame] method, which is registered
/// with [ui.window.onBeginFrame], invokes all the transient frame callbacks
/// registered with [scheduleFrameCallback]
and [addFrameCallback]
, in
/// registered with [scheduleFrameCallback], in
/// registration order. This includes all the [Ticker] instances that are
/// driving [AnimationController] objects, which means all of the active
/// [Animation] objects tick at this point.
...
...
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