Fix error about missing MediaQuery (#124243)
This commit is contained in:
committed by
GitHub
parent
2861c57a42
commit
98f35be7d9
@@ -301,10 +301,9 @@ bool debugCheckHasMediaQuery(BuildContext context) {
|
||||
context.describeOwnershipChain('The ownership chain for the affected widget is'),
|
||||
ErrorHint(
|
||||
'No MediaQuery ancestor could be found starting from the context '
|
||||
'that was passed to MediaQuery.of(). This can happen because you '
|
||||
'have not added a WidgetsApp, CupertinoApp, or MaterialApp widget '
|
||||
'(those widgets introduce a MediaQuery), or it can happen if the '
|
||||
'context you use comes from a widget above those widgets.',
|
||||
'that was passed to MediaQuery.of(). This can happen because the '
|
||||
'context used is not a descendant of a View widget, which introduces '
|
||||
'a MediaQuery.'
|
||||
),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -116,10 +116,9 @@ void main() {
|
||||
error.diagnostics.last.toStringDeep(),
|
||||
equalsIgnoringHashCodes(
|
||||
'No MediaQuery ancestor could be found starting from the context\n'
|
||||
'that was passed to MediaQuery.of(). This can happen because you\n'
|
||||
'have not added a WidgetsApp, CupertinoApp, or MaterialApp widget\n'
|
||||
'(those widgets introduce a MediaQuery), or it can happen if the\n'
|
||||
'context you use comes from a widget above those widgets.\n',
|
||||
'that was passed to MediaQuery.of(). This can happen because the\n'
|
||||
'context used is not a descendant of a View widget, which\n'
|
||||
'introduces a MediaQuery.\n'
|
||||
),
|
||||
);
|
||||
expect(
|
||||
@@ -139,10 +138,9 @@ void main() {
|
||||
endsWith(
|
||||
'[root]"\n' // End of ownership chain.
|
||||
' No MediaQuery ancestor could be found starting from the context\n'
|
||||
' that was passed to MediaQuery.of(). This can happen because you\n'
|
||||
' have not added a WidgetsApp, CupertinoApp, or MaterialApp widget\n'
|
||||
' (those widgets introduce a MediaQuery), or it can happen if the\n'
|
||||
' context you use comes from a widget above those widgets.\n',
|
||||
' that was passed to MediaQuery.of(). This can happen because the\n'
|
||||
' context used is not a descendant of a View widget, which\n'
|
||||
' introduces a MediaQuery.\n'
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -81,10 +81,9 @@ void main() {
|
||||
endsWith(
|
||||
'[root]"\n' // End of ownership chain.
|
||||
' No MediaQuery ancestor could be found starting from the context\n'
|
||||
' that was passed to MediaQuery.of(). This can happen because you\n'
|
||||
' have not added a WidgetsApp, CupertinoApp, or MaterialApp widget\n'
|
||||
' (those widgets introduce a MediaQuery), or it can happen if the\n'
|
||||
' context you use comes from a widget above those widgets.\n',
|
||||
' that was passed to MediaQuery.of(). This can happen because the\n'
|
||||
' context used is not a descendant of a View widget, which\n'
|
||||
' introduces a MediaQuery.\n'
|
||||
),
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user