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
98f35be7
Unverified
Commit
98f35be7
authored
Apr 06, 2023
by
Michael Goderbauer
Committed by
GitHub
Apr 06, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix error about missing MediaQuery (#124243)
parent
2861c57a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
16 deletions
+12
-16
debug.dart
packages/flutter/lib/src/widgets/debug.dart
+3
-4
debug_test.dart
packages/flutter/test/widgets/debug_test.dart
+6
-8
media_query_test.dart
packages/flutter/test/widgets/media_query_test.dart
+3
-4
No files found.
packages/flutter/lib/src/widgets/debug.dart
View file @
98f35be7
...
@@ -301,10 +301,9 @@ bool debugCheckHasMediaQuery(BuildContext context) {
...
@@ -301,10 +301,9 @@ bool debugCheckHasMediaQuery(BuildContext context) {
context
.
describeOwnershipChain
(
'The ownership chain for the affected widget is'
),
context
.
describeOwnershipChain
(
'The ownership chain for the affected widget is'
),
ErrorHint
(
ErrorHint
(
'No MediaQuery ancestor could be found starting from the context '
'No MediaQuery ancestor could be found starting from the context '
'that was passed to MediaQuery.of(). This can happen because you '
'that was passed to MediaQuery.of(). This can happen because the '
'have not added a WidgetsApp, CupertinoApp, or MaterialApp widget '
'context used is not a descendant of a View widget, which introduces '
'(those widgets introduce a MediaQuery), or it can happen if the '
'a MediaQuery.'
'context you use comes from a widget above those widgets.'
,
),
),
]);
]);
}
}
...
...
packages/flutter/test/widgets/debug_test.dart
View file @
98f35be7
...
@@ -116,10 +116,9 @@ void main() {
...
@@ -116,10 +116,9 @@ void main() {
error
.
diagnostics
.
last
.
toStringDeep
(),
error
.
diagnostics
.
last
.
toStringDeep
(),
equalsIgnoringHashCodes
(
equalsIgnoringHashCodes
(
'No MediaQuery ancestor could be found starting from the context
\n
'
'No MediaQuery ancestor could be found starting from the context
\n
'
'that was passed to MediaQuery.of(). This can happen because you
\n
'
'that was passed to MediaQuery.of(). This can happen because the
\n
'
'have not added a WidgetsApp, CupertinoApp, or MaterialApp widget
\n
'
'context used is not a descendant of a View widget, which
\n
'
'(those widgets introduce a MediaQuery), or it can happen if the
\n
'
'introduces a MediaQuery.
\n
'
'context you use comes from a widget above those widgets.
\n
'
,
),
),
);
);
expect
(
expect
(
...
@@ -139,10 +138,9 @@ void main() {
...
@@ -139,10 +138,9 @@ void main() {
endsWith
(
endsWith
(
'[root]"
\n
'
// End of ownership chain.
'[root]"
\n
'
// End of ownership chain.
' No MediaQuery ancestor could be found starting from the context
\n
'
' No MediaQuery ancestor could be found starting from the context
\n
'
' that was passed to MediaQuery.of(). This can happen because you
\n
'
' that was passed to MediaQuery.of(). This can happen because the
\n
'
' have not added a WidgetsApp, CupertinoApp, or MaterialApp widget
\n
'
' context used is not a descendant of a View widget, which
\n
'
' (those widgets introduce a MediaQuery), or it can happen if the
\n
'
' introduces a MediaQuery.
\n
'
' context you use comes from a widget above those widgets.
\n
'
,
),
),
);
);
}
}
...
...
packages/flutter/test/widgets/media_query_test.dart
View file @
98f35be7
...
@@ -81,10 +81,9 @@ void main() {
...
@@ -81,10 +81,9 @@ void main() {
endsWith
(
endsWith
(
'[root]"
\n
'
// End of ownership chain.
'[root]"
\n
'
// End of ownership chain.
' No MediaQuery ancestor could be found starting from the context
\n
'
' No MediaQuery ancestor could be found starting from the context
\n
'
' that was passed to MediaQuery.of(). This can happen because you
\n
'
' that was passed to MediaQuery.of(). This can happen because the
\n
'
' have not added a WidgetsApp, CupertinoApp, or MaterialApp widget
\n
'
' context used is not a descendant of a View widget, which
\n
'
' (those widgets introduce a MediaQuery), or it can happen if the
\n
'
' introduces a MediaQuery.
\n
'
' context you use comes from a widget above those widgets.
\n
'
,
),
),
);
);
});
});
...
...
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