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
a78c9f70
Unverified
Commit
a78c9f70
authored
Nov 30, 2017
by
Yegor
Committed by
GitHub
Nov 30, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove the unused dispatchDidChangeDependencies (#13224)
parent
41a5e5d8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
27 deletions
+23
-27
framework.dart
packages/flutter/lib/src/widgets/framework.dart
+23
-27
No files found.
packages/flutter/lib/src/widgets/framework.dart
View file @
a78c9f70
...
...
@@ -1939,10 +1939,7 @@ abstract class BuildContext {
/// Calling this method is O(1) with a small constant factor.
///
/// This method does not establish a relationship with the target in the way
/// that [inheritFromWidgetOfExactType] does. It is normally used by such
/// widgets to obtain their corresponding [InheritedElement] object so that they
/// can call [InheritedElement.dispatchDidChangeDependencies] to actually
/// notify the widgets that _did_ register such a relationship.
/// that [inheritFromWidgetOfExactType] does.
///
/// This method should not be called from [State.deactivate] or [State.dispose]
/// because the element tree is no longer stable at that time. To refer to
...
...
@@ -3331,15 +3328,15 @@ abstract class Element extends DiagnosticableTree implements BuildContext {
assert
(()
{
if
(
owner
.
_debugCurrentBuildTarget
==
null
)
{
throw
new
FlutterError
(
'
$methodName
for
${widget.runtimeType}
was called at an '
'inappropriate time.
\n
'
'It may only be called while the widgets are being built. A possible '
'cause of this error is when
$methodName
is called during '
'one of:
\n
'
' * network I/O event
\n
'
' * file I/O event
\n
'
' * timer
\n
'
' * microtask (caused by Future.then, async/await, scheduleMicrotask)'
'
$methodName
for
${widget.runtimeType}
was called at an '
'inappropriate time.
\n
'
'It may only be called while the widgets are being built. A possible '
'cause of this error is when
$methodName
is called during '
'one of:
\n
'
' * network I/O event
\n
'
' * file I/O event
\n
'
' * timer
\n
'
' * microtask (caused by Future.then, async/await, scheduleMicrotask)'
);
}
return
true
;
...
...
@@ -3990,23 +3987,22 @@ class InheritedElement extends ProxyElement {
super
.
debugDeactivated
();
}
/// Calls [Element.didChangeDependencies] of all dependent elements, if
/// [InheritedWidget.updateShouldNotify] returns true.
///
/// Notifies all dependent elements that this inherited widget has changed.
///
/// [InheritedElement] calls this function if the [widget]'s
/// [InheritedWidget.updateShouldNotify] returns true.
///
/// This method must be called during the build phase. Usually this method is
/// called automatically when an inherited widget is rebuilt, e.g. as a
/// result of calling [State.setState] above the inherited widget.
@override
void
notifyClients
(
InheritedWidget
oldWidget
)
{
if
(!
widget
.
updateShouldNotify
(
oldWidget
))
return
;
dispatchDidChangeDependencies
();
}
/// Notifies all dependent elements that this inherited widget has changed.
///
/// [InheritedElement] calls this function if [InheritedWidget.updateShouldNotify]
/// returns true. Subclasses of [InheritedElement] might wish to call this
/// function at other times if their inherited information changes outside of
/// the build phase. [InheritedWidget] subclasses can also call this directly
/// by first obtaining their [InheritedElement] using
/// [BuildContext.ancestorInheritedElementForWidgetOfExactType].
void
dispatchDidChangeDependencies
()
{
assert
(
_debugCheckOwnerBuildTargetExists
(
'dispatchDidChangeDependencies'
));
assert
(
_debugCheckOwnerBuildTargetExists
(
'notifyClients'
));
for
(
Element
dependent
in
_dependents
)
{
assert
(()
{
// check that it really is our descendant
...
...
@@ -4015,7 +4011,7 @@ class InheritedElement extends ProxyElement {
ancestor
=
ancestor
.
_parent
;
return
ancestor
==
this
;
}());
// check that it really de
e
pends on us
// check that it really depends on us
assert
(
dependent
.
_dependencies
.
contains
(
this
));
dependent
.
didChangeDependencies
();
}
...
...
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