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
99f19d05
Unverified
Commit
99f19d05
authored
Apr 28, 2021
by
Ren You
Committed by
GitHub
Apr 28, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Improve performance of debugCheckHasDirectionality (#81250)" (#81409)
This reverts commit
437ff210
.
parent
f4dee5c6
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
2 additions
and
52 deletions
+2
-52
debug.dart
packages/flutter/lib/src/material/debug.dart
+0
-11
material.dart
packages/flutter/lib/src/material/material.dart
+0
-2
scaffold.dart
packages/flutter/lib/src/material/scaffold.dart
+0
-6
animated_list.dart
packages/flutter/lib/src/widgets/animated_list.dart
+0
-8
debug.dart
packages/flutter/lib/src/widgets/debug.dart
+2
-6
inherited_theme.dart
packages/flutter/lib/src/widgets/inherited_theme.dart
+0
-3
navigator.dart
packages/flutter/lib/src/widgets/navigator.dart
+0
-4
overlay.dart
packages/flutter/lib/src/widgets/overlay.dart
+0
-2
page_storage.dart
packages/flutter/lib/src/widgets/page_storage.dart
+0
-2
reorderable_list.dart
packages/flutter/lib/src/widgets/reorderable_list.dart
+0
-8
No files found.
packages/flutter/lib/src/material/debug.dart
View file @
99f19d05
...
@@ -20,8 +20,6 @@ import 'scaffold.dart' show Scaffold, ScaffoldMessenger;
...
@@ -20,8 +20,6 @@ import 'scaffold.dart' show Scaffold, ScaffoldMessenger;
/// assert(debugCheckHasMaterial(context));
/// assert(debugCheckHasMaterial(context));
/// ```
/// ```
///
///
/// This method can be expensive (it walks the element tree).
///
/// Does nothing if asserts are disabled. Always returns true.
/// Does nothing if asserts are disabled. Always returns true.
bool
debugCheckHasMaterial
(
BuildContext
context
)
{
bool
debugCheckHasMaterial
(
BuildContext
context
)
{
assert
(()
{
assert
(()
{
...
@@ -64,11 +62,6 @@ bool debugCheckHasMaterial(BuildContext context) {
...
@@ -64,11 +62,6 @@ bool debugCheckHasMaterial(BuildContext context) {
/// assert(debugCheckHasMaterialLocalizations(context));
/// assert(debugCheckHasMaterialLocalizations(context));
/// ```
/// ```
///
///
/// This function has the side-effect of establishing an inheritance
/// relationship with the nearest [Localizations] widget (see
/// [BuildContext.dependOnInheritedWidgetOfExactType]). This is ok if the caller
/// always also calls [Localizations.of] or [Localizations.localeOf].
///
/// Does nothing if asserts are disabled. Always returns true.
/// Does nothing if asserts are disabled. Always returns true.
bool
debugCheckHasMaterialLocalizations
(
BuildContext
context
)
{
bool
debugCheckHasMaterialLocalizations
(
BuildContext
context
)
{
assert
(()
{
assert
(()
{
...
@@ -109,8 +102,6 @@ bool debugCheckHasMaterialLocalizations(BuildContext context) {
...
@@ -109,8 +102,6 @@ bool debugCheckHasMaterialLocalizations(BuildContext context) {
/// assert(debugCheckHasScaffold(context));
/// assert(debugCheckHasScaffold(context));
/// ```
/// ```
///
///
/// This method can be expensive (it walks the element tree).
///
/// Does nothing if asserts are disabled. Always returns true.
/// Does nothing if asserts are disabled. Always returns true.
bool
debugCheckHasScaffold
(
BuildContext
context
)
{
bool
debugCheckHasScaffold
(
BuildContext
context
)
{
assert
(()
{
assert
(()
{
...
@@ -142,8 +133,6 @@ bool debugCheckHasScaffold(BuildContext context) {
...
@@ -142,8 +133,6 @@ bool debugCheckHasScaffold(BuildContext context) {
/// assert(debugCheckHasScaffoldMessenger(context));
/// assert(debugCheckHasScaffoldMessenger(context));
/// ```
/// ```
///
///
/// This method can be expensive (it walks the element tree).
///
/// Does nothing if asserts are disabled. Always returns true.
/// Does nothing if asserts are disabled. Always returns true.
bool
debugCheckHasScaffoldMessenger
(
BuildContext
context
)
{
bool
debugCheckHasScaffoldMessenger
(
BuildContext
context
)
{
assert
(()
{
assert
(()
{
...
...
packages/flutter/lib/src/material/material.dart
View file @
99f19d05
...
@@ -310,8 +310,6 @@ class Material extends StatefulWidget {
...
@@ -310,8 +310,6 @@ class Material extends StatefulWidget {
/// ```dart
/// ```dart
/// MaterialInkController inkController = Material.of(context);
/// MaterialInkController inkController = Material.of(context);
/// ```
/// ```
///
/// This method can be expensive (it walks the element tree).
static
MaterialInkController
?
of
(
BuildContext
context
)
{
static
MaterialInkController
?
of
(
BuildContext
context
)
{
return
context
.
findAncestorRenderObjectOfType
<
_RenderInkFeatures
>();
return
context
.
findAncestorRenderObjectOfType
<
_RenderInkFeatures
>();
}
}
...
...
packages/flutter/lib/src/material/scaffold.dart
View file @
99f19d05
...
@@ -1820,8 +1820,6 @@ class Scaffold extends StatefulWidget {
...
@@ -1820,8 +1820,6 @@ class Scaffold extends StatefulWidget {
/// If no instance of this class encloses the given context, will cause an
/// If no instance of this class encloses the given context, will cause an
/// assert in debug mode, and throw an exception in release mode.
/// assert in debug mode, and throw an exception in release mode.
///
///
/// This method can be expensive (it walks the element tree).
///
/// {@tool dartpad --template=freeform}
/// {@tool dartpad --template=freeform}
/// Typical usage of the [Scaffold.of] function is to call it from within the
/// Typical usage of the [Scaffold.of] function is to call it from within the
/// `build` method of a child of a [Scaffold].
/// `build` method of a child of a [Scaffold].
...
@@ -2001,8 +1999,6 @@ class Scaffold extends StatefulWidget {
...
@@ -2001,8 +1999,6 @@ class Scaffold extends StatefulWidget {
/// If no instance of this class encloses the given context, will return null.
/// If no instance of this class encloses the given context, will return null.
/// To throw an exception instead, use [of] instead of this function.
/// To throw an exception instead, use [of] instead of this function.
///
///
/// This method can be expensive (it walks the element tree).
///
/// See also:
/// See also:
///
///
/// * [of], a similar function to this one that throws if no instance
/// * [of], a similar function to this one that throws if no instance
...
@@ -2070,8 +2066,6 @@ class Scaffold extends StatefulWidget {
...
@@ -2070,8 +2066,6 @@ class Scaffold extends StatefulWidget {
/// [Scaffold] so that the client widget gets rebuilt whenever the [hasDrawer]
/// [Scaffold] so that the client widget gets rebuilt whenever the [hasDrawer]
/// value changes.
/// value changes.
///
///
/// This method can be expensive (it walks the element tree).
///
/// See also:
/// See also:
///
///
/// * [Scaffold.of], which provides access to the [ScaffoldState] object as a
/// * [Scaffold.of], which provides access to the [ScaffoldState] object as a
...
...
packages/flutter/lib/src/widgets/animated_list.dart
View file @
99f19d05
...
@@ -392,8 +392,6 @@ class AnimatedList extends StatefulWidget {
...
@@ -392,8 +392,6 @@ class AnimatedList extends StatefulWidget {
/// If no [AnimatedList] surrounds the context given, then this function will
/// If no [AnimatedList] surrounds the context given, then this function will
/// assert in debug mode and throw an exception in release mode.
/// assert in debug mode and throw an exception in release mode.
///
///
/// This method can be expensive (it walks the element tree).
///
/// See also:
/// See also:
///
///
/// * [maybeOf], a similar function that will return null if no
/// * [maybeOf], a similar function that will return null if no
...
@@ -431,8 +429,6 @@ class AnimatedList extends StatefulWidget {
...
@@ -431,8 +429,6 @@ class AnimatedList extends StatefulWidget {
/// If no [AnimatedList] surrounds the context given, then this function will
/// If no [AnimatedList] surrounds the context given, then this function will
/// return null.
/// return null.
///
///
/// This method can be expensive (it walks the element tree).
///
/// See also:
/// See also:
///
///
/// * [of], a similar function that will throw if no [AnimatedList] ancestor
/// * [of], a similar function that will throw if no [AnimatedList] ancestor
...
@@ -812,8 +808,6 @@ class SliverAnimatedList extends StatefulWidget {
...
@@ -812,8 +808,6 @@ class SliverAnimatedList extends StatefulWidget {
/// If no [SliverAnimatedList] surrounds the context given, then this function
/// If no [SliverAnimatedList] surrounds the context given, then this function
/// will assert in debug mode and throw an exception in release mode.
/// will assert in debug mode and throw an exception in release mode.
///
///
/// This method can be expensive (it walks the element tree).
///
/// See also:
/// See also:
///
///
/// * [maybeOf], a similar function that will return null if no
/// * [maybeOf], a similar function that will return null if no
...
@@ -849,8 +843,6 @@ class SliverAnimatedList extends StatefulWidget {
...
@@ -849,8 +843,6 @@ class SliverAnimatedList extends StatefulWidget {
/// If no [SliverAnimatedList] surrounds the context given, then this function
/// If no [SliverAnimatedList] surrounds the context given, then this function
/// will return null.
/// will return null.
///
///
/// This method can be expensive (it walks the element tree).
///
/// See also:
/// See also:
///
///
/// * [of], a similar function that will throw if no [SliverAnimatedList]
/// * [of], a similar function that will throw if no [SliverAnimatedList]
...
...
packages/flutter/lib/src/widgets/debug.dart
View file @
99f19d05
...
@@ -184,8 +184,6 @@ bool debugItemsHaveDuplicateKeys(Iterable<Widget> items) {
...
@@ -184,8 +184,6 @@ bool debugItemsHaveDuplicateKeys(Iterable<Widget> items) {
/// assert(debugCheckHasTable(context));
/// assert(debugCheckHasTable(context));
/// ```
/// ```
///
///
/// This method can be expensive (it walks the element tree).
///
/// Does nothing if asserts are disabled. Always returns true.
/// Does nothing if asserts are disabled. Always returns true.
bool
debugCheckHasTable
(
BuildContext
context
)
{
bool
debugCheckHasTable
(
BuildContext
context
)
{
assert
(()
{
assert
(()
{
...
@@ -217,7 +215,7 @@ bool debugCheckHasTable(BuildContext context) {
...
@@ -217,7 +215,7 @@ bool debugCheckHasTable(BuildContext context) {
/// Does nothing if asserts are disabled. Always returns true.
/// Does nothing if asserts are disabled. Always returns true.
bool
debugCheckHasMediaQuery
(
BuildContext
context
)
{
bool
debugCheckHasMediaQuery
(
BuildContext
context
)
{
assert
(()
{
assert
(()
{
if
(
context
.
widget
is
!
MediaQuery
&&
context
.
getElementForInherited
WidgetOfExactType
<
MediaQuery
>()
==
null
)
{
if
(
context
.
widget
is
!
MediaQuery
&&
context
.
findAncestor
WidgetOfExactType
<
MediaQuery
>()
==
null
)
{
throw
FlutterError
.
fromParts
(<
DiagnosticsNode
>[
throw
FlutterError
.
fromParts
(<
DiagnosticsNode
>[
ErrorSummary
(
'No MediaQuery widget ancestor found.'
),
ErrorSummary
(
'No MediaQuery widget ancestor found.'
),
ErrorDescription
(
'
${context.widget.runtimeType}
widgets require a MediaQuery widget ancestor.'
),
ErrorDescription
(
'
${context.widget.runtimeType}
widgets require a MediaQuery widget ancestor.'
),
...
@@ -269,7 +267,7 @@ bool debugCheckHasMediaQuery(BuildContext context) {
...
@@ -269,7 +267,7 @@ bool debugCheckHasMediaQuery(BuildContext context) {
/// Does nothing if asserts are disabled. Always returns true.
/// Does nothing if asserts are disabled. Always returns true.
bool
debugCheckHasDirectionality
(
BuildContext
context
,
{
String
?
why
,
String
?
hint
,
String
?
alternative
})
{
bool
debugCheckHasDirectionality
(
BuildContext
context
,
{
String
?
why
,
String
?
hint
,
String
?
alternative
})
{
assert
(()
{
assert
(()
{
if
(
context
.
widget
is
!
Directionality
&&
context
.
getElementForInherited
WidgetOfExactType
<
Directionality
>()
==
null
)
{
if
(
context
.
widget
is
!
Directionality
&&
context
.
findAncestor
WidgetOfExactType
<
Directionality
>()
==
null
)
{
why
=
why
==
null
?
''
:
'
$why
'
;
why
=
why
==
null
?
''
:
'
$why
'
;
throw
FlutterError
.
fromParts
(<
DiagnosticsNode
>[
throw
FlutterError
.
fromParts
(<
DiagnosticsNode
>[
ErrorSummary
(
'No Directionality widget found.'
),
ErrorSummary
(
'No Directionality widget found.'
),
...
@@ -375,8 +373,6 @@ bool debugCheckHasWidgetsLocalizations(BuildContext context) {
...
@@ -375,8 +373,6 @@ bool debugCheckHasWidgetsLocalizations(BuildContext context) {
/// assert(debugCheckHasOverlay(context));
/// assert(debugCheckHasOverlay(context));
/// ```
/// ```
///
///
/// This method can be expensive (it walks the element tree).
///
/// Does nothing if asserts are disabled. Always returns true.
/// Does nothing if asserts are disabled. Always returns true.
bool
debugCheckHasOverlay
(
BuildContext
context
)
{
bool
debugCheckHasOverlay
(
BuildContext
context
)
{
assert
(()
{
assert
(()
{
...
...
packages/flutter/lib/src/widgets/inherited_theme.dart
View file @
99f19d05
...
@@ -146,9 +146,6 @@ abstract class InheritedTheme extends InheritedWidget {
...
@@ -146,9 +146,6 @@ abstract class InheritedTheme extends InheritedWidget {
/// this method is called again to re-capture the updated themes.
/// this method is called again to re-capture the updated themes.
///
///
/// To wrap a [Widget] in the captured themes, call [CapturedThemes.wrap].
/// To wrap a [Widget] in the captured themes, call [CapturedThemes.wrap].
///
/// This method can be expensive if there are many widgets between `from` and
/// `to` (it walks the element tree between those nodes).
static
CapturedThemes
capture
({
required
BuildContext
from
,
required
BuildContext
?
to
})
{
static
CapturedThemes
capture
({
required
BuildContext
from
,
required
BuildContext
?
to
})
{
assert
(
from
!=
null
);
assert
(
from
!=
null
);
...
...
packages/flutter/lib/src/widgets/navigator.dart
View file @
99f19d05
...
@@ -2712,8 +2712,6 @@ class Navigator extends StatefulWidget {
...
@@ -2712,8 +2712,6 @@ class Navigator extends StatefulWidget {
///
///
/// If there is no [Navigator] in the give `context`, this function will throw
/// If there is no [Navigator] in the give `context`, this function will throw
/// a [FlutterError] in debug mode, and an exception in release mode.
/// a [FlutterError] in debug mode, and an exception in release mode.
///
/// This method can be expensive (it walks the element tree).
static
NavigatorState
of
(
static
NavigatorState
of
(
BuildContext
context
,
{
BuildContext
context
,
{
bool
rootNavigator
=
false
,
bool
rootNavigator
=
false
,
...
@@ -2762,8 +2760,6 @@ class Navigator extends StatefulWidget {
...
@@ -2762,8 +2760,6 @@ class Navigator extends StatefulWidget {
/// subsequent instances of [Navigator].
/// subsequent instances of [Navigator].
///
///
/// Will return null if there is no ancestor [Navigator] in the `context`.
/// Will return null if there is no ancestor [Navigator] in the `context`.
///
/// This method can be expensive (it walks the element tree).
static
NavigatorState
?
maybeOf
(
static
NavigatorState
?
maybeOf
(
BuildContext
context
,
{
BuildContext
context
,
{
bool
rootNavigator
=
false
,
bool
rootNavigator
=
false
,
...
...
packages/flutter/lib/src/widgets/overlay.dart
View file @
99f19d05
...
@@ -284,8 +284,6 @@ class Overlay extends StatefulWidget {
...
@@ -284,8 +284,6 @@ class Overlay extends StatefulWidget {
/// If `rootOverlay` is set to true, the state from the furthest instance of
/// If `rootOverlay` is set to true, the state from the furthest instance of
/// this class is given instead. Useful for installing overlay entries
/// this class is given instead. Useful for installing overlay entries
/// above all subsequent instances of [Overlay].
/// above all subsequent instances of [Overlay].
///
/// This method can be expensive (it walks the element tree).
static
OverlayState
?
of
(
static
OverlayState
?
of
(
BuildContext
context
,
{
BuildContext
context
,
{
bool
rootOverlay
=
false
,
bool
rootOverlay
=
false
,
...
...
packages/flutter/lib/src/widgets/page_storage.dart
View file @
99f19d05
...
@@ -267,8 +267,6 @@ class PageStorage extends StatelessWidget {
...
@@ -267,8 +267,6 @@ class PageStorage extends StatelessWidget {
/// ```dart
/// ```dart
/// PageStorageBucket bucket = PageStorage.of(context);
/// PageStorageBucket bucket = PageStorage.of(context);
/// ```
/// ```
///
/// This method can be expensive (it walks the element tree).
static
PageStorageBucket
?
of
(
BuildContext
context
)
{
static
PageStorageBucket
?
of
(
BuildContext
context
)
{
final
PageStorage
?
widget
=
context
.
findAncestorWidgetOfExactType
<
PageStorage
>();
final
PageStorage
?
widget
=
context
.
findAncestorWidgetOfExactType
<
PageStorage
>();
return
widget
?.
bucket
;
return
widget
?.
bucket
;
...
...
packages/flutter/lib/src/widgets/reorderable_list.dart
View file @
99f19d05
...
@@ -220,8 +220,6 @@ class ReorderableList extends StatefulWidget {
...
@@ -220,8 +220,6 @@ class ReorderableList extends StatefulWidget {
/// If no [ReorderableList] surrounds the given context, then this function
/// If no [ReorderableList] surrounds the given context, then this function
/// will assert in debug mode and throw an exception in release mode.
/// will assert in debug mode and throw an exception in release mode.
///
///
/// This method can be expensive (it walks the element tree).
///
/// See also:
/// See also:
///
///
/// * [maybeOf], a similar function that will return null if no
/// * [maybeOf], a similar function that will return null if no
...
@@ -259,8 +257,6 @@ class ReorderableList extends StatefulWidget {
...
@@ -259,8 +257,6 @@ class ReorderableList extends StatefulWidget {
/// If no [ReorderableList] surrounds the context given, then this function will
/// If no [ReorderableList] surrounds the context given, then this function will
/// return null.
/// return null.
///
///
/// This method can be expensive (it walks the element tree).
///
/// See also:
/// See also:
///
///
/// * [of], a similar function that will throw if no [ReorderableList] ancestor
/// * [of], a similar function that will throw if no [ReorderableList] ancestor
...
@@ -412,8 +408,6 @@ class SliverReorderableList extends StatefulWidget {
...
@@ -412,8 +408,6 @@ class SliverReorderableList extends StatefulWidget {
/// If no [SliverReorderableList] surrounds the context given, this function
/// If no [SliverReorderableList] surrounds the context given, this function
/// will assert in debug mode and throw an exception in release mode.
/// will assert in debug mode and throw an exception in release mode.
///
///
/// This method can be expensive (it walks the element tree).
///
/// See also:
/// See also:
///
///
/// * [maybeOf], a similar function that will return null if no
/// * [maybeOf], a similar function that will return null if no
...
@@ -453,8 +447,6 @@ class SliverReorderableList extends StatefulWidget {
...
@@ -453,8 +447,6 @@ class SliverReorderableList extends StatefulWidget {
/// If no [SliverReorderableList] surrounds the context given, this function
/// If no [SliverReorderableList] surrounds the context given, this function
/// will return null.
/// will return null.
///
///
/// This method can be expensive (it walks the element tree).
///
/// See also:
/// See also:
///
///
/// * [of], a similar function that will throw if no [SliverReorderableList]
/// * [of], a similar function that will throw if no [SliverReorderableList]
...
...
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