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
7a926dcb
Unverified
Commit
7a926dcb
authored
Feb 01, 2023
by
Michael Goderbauer
Committed by
GitHub
Feb 01, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Deprecate MediaQuery[Data].fromWindow (#119647)
* Deprecate MediaQuery[Data].fromWindow * ++ * dart fix
parent
8fd5d4eb
Changes
29
Hide whitespace changes
Inline
Side-by-side
Showing
29 changed files
with
101 additions
and
76 deletions
+101
-76
fix_widgets.yaml
packages/flutter/lib/fix_data/fix_widgets/fix_widgets.yaml
+12
-1
media_query.dart
packages/flutter/lib/src/widgets/media_query.dart
+23
-13
route_test.dart
packages/flutter/test/cupertino/route_test.dart
+1
-1
action_chip_test.dart
packages/flutter/test/material/action_chip_test.dart
+1
-1
chip_test.dart
packages/flutter/test/material/chip_test.dart
+1
-1
choice_chip_test.dart
packages/flutter/test/material/choice_chip_test.dart
+1
-1
dropdown_form_field_test.dart
packages/flutter/test/material/dropdown_form_field_test.dart
+1
-1
dropdown_test.dart
packages/flutter/test/material/dropdown_test.dart
+2
-2
filter_chip_test.dart
packages/flutter/test/material/filter_chip_test.dart
+1
-1
input_chip_test.dart
packages/flutter/test/material/input_chip_test.dart
+1
-1
menu_anchor_test.dart
packages/flutter/test/material/menu_anchor_test.dart
+2
-2
page_test.dart
packages/flutter/test/material/page_test.dart
+2
-2
popup_menu_test.dart
packages/flutter/test/material/popup_menu_test.dart
+1
-1
range_slider_test.dart
packages/flutter/test/material/range_slider_test.dart
+1
-1
slider_theme_test.dart
packages/flutter/test/material/slider_theme_test.dart
+4
-4
text_field_test.dart
packages/flutter/test/material/text_field_test.dart
+1
-1
tooltip_test.dart
packages/flutter/test/material/tooltip_test.dart
+7
-9
display_feature_sub_screen_test.dart
...flutter/test/widgets/display_feature_sub_screen_test.dart
+7
-7
heroes_test.dart
packages/flutter/test/widgets/heroes_test.dart
+1
-1
media_query_test.dart
packages/flutter/test/widgets/media_query_test.dart
+10
-9
navigator_restoration_test.dart
...ages/flutter/test/widgets/navigator_restoration_test.dart
+2
-2
navigator_test.dart
packages/flutter/test/widgets/navigator_test.dart
+6
-6
page_view_test.dart
packages/flutter/test/widgets/page_view_test.dart
+1
-1
reparent_state_with_layout_builder_test.dart
...test/widgets/reparent_state_with_layout_builder_test.dart
+1
-1
scroll_position_test.dart
packages/flutter/test/widgets/scroll_position_test.dart
+1
-1
semantics_debugger_test.dart
packages/flutter/test/widgets/semantics_debugger_test.dart
+1
-1
snapshot_widget_test.dart
packages/flutter/test/widgets/snapshot_widget_test.dart
+1
-2
widgets.dart
packages/flutter/test_fixes/widgets/widgets.dart
+4
-1
widgets.dart.expect
packages/flutter/test_fixes/widgets/widgets.dart.expect
+4
-1
No files found.
packages/flutter/lib/fix_data/fix_widgets/fix_widgets.yaml
View file @
7a926dcb
...
@@ -23,7 +23,18 @@
...
@@ -23,7 +23,18 @@
# * ListWheelScrollView: fix_list_wheel_scroll_view.yaml
# * ListWheelScrollView: fix_list_wheel_scroll_view.yaml
version
:
1
version
:
1
transforms
:
transforms
:
# Changes made in https://github.com/flutter/flutter/pull/119186 and https://github.com/flutter/flutter/pull/81067.
# Changes made in https://github.com/flutter/flutter/pull/119647
-
title
:
"
Migrate
to
'fromView'"
date
:
2022-10-28
element
:
uris
:
[
'
widgets.dart'
,
'
material.dart'
,
'
cupertino.dart'
]
constructor
:
'
fromWindow'
inClass
:
'
MediaQueryData'
changes
:
-
kind
:
'
rename'
newName
:
'
fromView'
# Changes made in https://github.com/flutter/flutter/pull/119186 and https://github.com/flutter/flutter/pull/81067
-
title
:
"
Remove
'vsync'"
-
title
:
"
Remove
'vsync'"
date
:
2023-01-30
date
:
2023-01-30
element
:
element
:
...
...
packages/flutter/lib/src/widgets/media_query.dart
View file @
7a926dcb
...
@@ -160,13 +160,16 @@ class MediaQueryData {
...
@@ -160,13 +160,16 @@ class MediaQueryData {
this
.
displayFeatures
=
const
<
ui
.
DisplayFeature
>[],
this
.
displayFeatures
=
const
<
ui
.
DisplayFeature
>[],
});
});
///
Creates data for a media query based on the given window
.
///
Deprecated. Use [MediaQueryData.fromView] instead
.
///
///
/// If you use this, you should ensure that you also register for
/// This constructor was operating on a single window assumption. In
/// notifications so that you can update your [MediaQueryData] when the
/// preparation for Flutter's upcoming multi-window support, it has been
/// window's metrics change. For example, see
/// deprecated.
/// [WidgetsBindingObserver.didChangeMetrics] or
@Deprecated
(
/// [dart:ui.PlatformDispatcher.onMetricsChanged].
'Use MediaQueryData.fromView instead. '
'This constructor was deprecated in preparation for the upcoming multi-window support. '
'This feature was deprecated after v3.7.0-32.0.pre.'
)
factory
MediaQueryData
.
fromWindow
(
ui
.
FlutterView
window
)
=>
MediaQueryData
.
fromView
(
window
);
factory
MediaQueryData
.
fromWindow
(
ui
.
FlutterView
window
)
=>
MediaQueryData
.
fromView
(
window
);
/// Creates data for a [MediaQuery] based on the given `view`.
/// Creates data for a [MediaQuery] based on the given `view`.
...
@@ -918,14 +921,21 @@ class MediaQuery extends InheritedModel<_MediaQueryAspect> {
...
@@ -918,14 +921,21 @@ class MediaQuery extends InheritedModel<_MediaQueryAspect> {
);
);
}
}
/// Provides a [MediaQuery] which is built and updated using the latest
/// Deprecated. Use [MediaQuery.fromView] instead.
/// [WidgetsBinding.window] values.
///
///
/// Th
e [MediaQuery] is wrapped in a separate widget to ensure that only it
/// Th
is constructor was operating on a single window assumption. In
///
and its dependents are updated when `window` changes, instead of
///
preparation for Flutter's upcoming multi-window support, it has been
///
rebuilding the whole widget tree
.
///
deprecated
.
///
///
/// The [child] argument is required and must not be null.
/// Replaced by [MediaQuery.fromView], which requires specifying the
/// [FlutterView] the [MediaQuery] is constructed for. The [FlutterView] can,
/// for example, be obtained from the context via [View.of] or from
/// [PlatformDispatcher.views].
@Deprecated
(
'Use MediaQuery.fromView instead. '
'This constructor was deprecated in preparation for the upcoming multi-window support. '
'This feature was deprecated after v3.7.0-32.0.pre.'
)
static
Widget
fromWindow
({
static
Widget
fromWindow
({
Key
?
key
,
Key
?
key
,
required
Widget
child
,
required
Widget
child
,
...
@@ -953,7 +963,7 @@ class MediaQuery extends InheritedModel<_MediaQueryAspect> {
...
@@ -953,7 +963,7 @@ class MediaQuery extends InheritedModel<_MediaQueryAspect> {
/// The injected [MediaQuery] automatically updates when any of the data used
/// The injected [MediaQuery] automatically updates when any of the data used
/// to construct it changes.
/// to construct it changes.
///
///
/// The [view] and [child] argument
is
required and must not be null.
/// The [view] and [child] argument
s are
required and must not be null.
static
Widget
fromView
({
static
Widget
fromView
({
Key
?
key
,
Key
?
key
,
required
FlutterView
view
,
required
FlutterView
view
,
...
...
packages/flutter/test/cupertino/route_test.dart
View file @
7a926dcb
...
@@ -2216,7 +2216,7 @@ Widget buildNavigator({
...
@@ -2216,7 +2216,7 @@ Widget buildNavigator({
TransitionDelegate
<
dynamic
>?
transitionDelegate
,
TransitionDelegate
<
dynamic
>?
transitionDelegate
,
})
{
})
{
return
MediaQuery
(
return
MediaQuery
(
data:
MediaQueryData
.
from
Windo
w
(
WidgetsBinding
.
instance
.
window
),
data:
MediaQueryData
.
from
Vie
w
(
WidgetsBinding
.
instance
.
window
),
child:
Localizations
(
child:
Localizations
(
locale:
const
Locale
(
'en'
,
'US'
),
locale:
const
Locale
(
'en'
,
'US'
),
delegates:
const
<
LocalizationsDelegate
<
dynamic
>>[
delegates:
const
<
LocalizationsDelegate
<
dynamic
>>[
...
...
packages/flutter/test/material/action_chip_test.dart
View file @
7a926dcb
...
@@ -17,7 +17,7 @@ Widget wrapForChip({
...
@@ -17,7 +17,7 @@ Widget wrapForChip({
home:
Directionality
(
home:
Directionality
(
textDirection:
textDirection
,
textDirection:
textDirection
,
child:
MediaQuery
(
child:
MediaQuery
(
data:
MediaQueryData
.
fromWindow
(
WidgetsBinding
.
instance
.
window
).
copyWith
(
textScaleFactor:
textScaleFactor
),
data:
MediaQueryData
(
textScaleFactor:
textScaleFactor
),
child:
Material
(
child:
child
),
child:
Material
(
child:
child
),
),
),
),
),
...
...
packages/flutter/test/material/chip_test.dart
View file @
7a926dcb
...
@@ -80,7 +80,7 @@ Widget wrapForChip({
...
@@ -80,7 +80,7 @@ Widget wrapForChip({
home:
Directionality
(
home:
Directionality
(
textDirection:
textDirection
,
textDirection:
textDirection
,
child:
MediaQuery
(
child:
MediaQuery
(
data:
MediaQueryData
.
fromWindow
(
WidgetsBinding
.
instance
.
window
).
copyWith
(
textScaleFactor:
textScaleFactor
),
data:
MediaQueryData
(
textScaleFactor:
textScaleFactor
),
child:
Material
(
child:
child
),
child:
Material
(
child:
child
),
),
),
),
),
...
...
packages/flutter/test/material/choice_chip_test.dart
View file @
7a926dcb
...
@@ -46,7 +46,7 @@ Widget wrapForChip({
...
@@ -46,7 +46,7 @@ Widget wrapForChip({
home:
Directionality
(
home:
Directionality
(
textDirection:
textDirection
,
textDirection:
textDirection
,
child:
MediaQuery
(
child:
MediaQuery
(
data:
MediaQueryData
.
fromWindow
(
WidgetsBinding
.
instance
.
window
).
copyWith
(
textScaleFactor:
textScaleFactor
),
data:
MediaQueryData
(
textScaleFactor:
textScaleFactor
),
child:
Material
(
child:
child
),
child:
Material
(
child:
child
),
),
),
),
),
...
...
packages/flutter/test/material/dropdown_form_field_test.dart
View file @
7a926dcb
...
@@ -90,7 +90,7 @@ class _TestAppState extends State<TestApp> {
...
@@ -90,7 +90,7 @@ class _TestAppState extends State<TestApp> {
DefaultMaterialLocalizations
.
delegate
,
DefaultMaterialLocalizations
.
delegate
,
],
],
child:
MediaQuery
(
child:
MediaQuery
(
data:
MediaQueryData
.
fromWindow
(
WidgetsBinding
.
instance
.
window
).
copyWith
(
size:
widget
.
mediaSize
),
data:
const
MediaQueryData
(
).
copyWith
(
size:
widget
.
mediaSize
),
child:
Directionality
(
child:
Directionality
(
textDirection:
widget
.
textDirection
,
textDirection:
widget
.
textDirection
,
child:
Navigator
(
child:
Navigator
(
...
...
packages/flutter/test/material/dropdown_test.dart
View file @
7a926dcb
...
@@ -246,7 +246,7 @@ class _TestAppState extends State<TestApp> {
...
@@ -246,7 +246,7 @@ class _TestAppState extends State<TestApp> {
DefaultMaterialLocalizations
.
delegate
,
DefaultMaterialLocalizations
.
delegate
,
],
],
child:
MediaQuery
(
child:
MediaQuery
(
data:
MediaQueryData
.
from
Window
(
WidgetsBinding
.
instance
.
window
).
copyWith
(
size:
widget
.
mediaSize
),
data:
MediaQueryData
.
from
View
(
View
.
of
(
context
)
).
copyWith
(
size:
widget
.
mediaSize
),
child:
Directionality
(
child:
Directionality
(
textDirection:
widget
.
textDirection
,
textDirection:
widget
.
textDirection
,
child:
Navigator
(
child:
Navigator
(
...
@@ -401,7 +401,7 @@ void main() {
...
@@ -401,7 +401,7 @@ void main() {
return
Directionality
(
return
Directionality
(
textDirection:
TextDirection
.
ltr
,
textDirection:
TextDirection
.
ltr
,
child:
MediaQuery
(
child:
MediaQuery
(
data:
MediaQueryData
.
from
Window
(
WidgetsBinding
.
instance
.
window
),
data:
MediaQueryData
.
from
View
(
tester
.
binding
.
window
),
child:
Navigator
(
child:
Navigator
(
initialRoute:
'/'
,
initialRoute:
'/'
,
onGenerateRoute:
(
RouteSettings
settings
)
{
onGenerateRoute:
(
RouteSettings
settings
)
{
...
...
packages/flutter/test/material/filter_chip_test.dart
View file @
7a926dcb
...
@@ -19,7 +19,7 @@ Widget wrapForChip({
...
@@ -19,7 +19,7 @@ Widget wrapForChip({
home:
Directionality
(
home:
Directionality
(
textDirection:
textDirection
,
textDirection:
textDirection
,
child:
MediaQuery
(
child:
MediaQuery
(
data:
MediaQueryData
.
fromWindow
(
WidgetsBinding
.
instance
.
window
).
copyWith
(
textScaleFactor:
textScaleFactor
),
data:
MediaQueryData
(
textScaleFactor:
textScaleFactor
),
child:
Material
(
child:
child
),
child:
Material
(
child:
child
),
),
),
),
),
...
...
packages/flutter/test/material/input_chip_test.dart
View file @
7a926dcb
...
@@ -19,7 +19,7 @@ Widget wrapForChip({
...
@@ -19,7 +19,7 @@ Widget wrapForChip({
home:
Directionality
(
home:
Directionality
(
textDirection:
textDirection
,
textDirection:
textDirection
,
child:
MediaQuery
(
child:
MediaQuery
(
data:
MediaQueryData
.
fromWindow
(
WidgetsBinding
.
instance
.
window
).
copyWith
(
textScaleFactor:
textScaleFactor
),
data:
MediaQueryData
(
textScaleFactor:
textScaleFactor
),
child:
Material
(
child:
child
),
child:
Material
(
child:
child
),
),
),
),
),
...
...
packages/flutter/test/material/menu_anchor_test.dart
View file @
7a926dcb
...
@@ -35,7 +35,7 @@ void main() {
...
@@ -35,7 +35,7 @@ void main() {
}
}
setUpAll
(()
{
setUpAll
(()
{
final
MediaQueryData
mediaQueryData
=
MediaQueryData
.
from
Windo
w
(
TestWidgetsFlutterBinding
.
instance
.
window
);
final
MediaQueryData
mediaQueryData
=
MediaQueryData
.
from
Vie
w
(
TestWidgetsFlutterBinding
.
instance
.
window
);
defaultSize
=
mediaQueryData
.
size
;
defaultSize
=
mediaQueryData
.
size
;
});
});
...
@@ -1205,7 +1205,7 @@ void main() {
...
@@ -1205,7 +1205,7 @@ void main() {
testWidgets
(
'menus close on view size change'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'menus close on view size change'
,
(
WidgetTester
tester
)
async
{
final
ScrollController
scrollController
=
ScrollController
();
final
ScrollController
scrollController
=
ScrollController
();
final
MediaQueryData
mediaQueryData
=
MediaQueryData
.
from
Windo
w
(
tester
.
binding
.
window
);
final
MediaQueryData
mediaQueryData
=
MediaQueryData
.
from
Vie
w
(
tester
.
binding
.
window
);
Widget
build
(
Size
size
)
{
Widget
build
(
Size
size
)
{
return
MaterialApp
(
return
MaterialApp
(
...
...
packages/flutter/test/material/page_test.dart
View file @
7a926dcb
...
@@ -1219,7 +1219,7 @@ Widget buildNavigator({
...
@@ -1219,7 +1219,7 @@ Widget buildNavigator({
TransitionDelegate
<
dynamic
>?
transitionDelegate
,
TransitionDelegate
<
dynamic
>?
transitionDelegate
,
})
{
})
{
return
MediaQuery
(
return
MediaQuery
(
data:
MediaQueryData
.
from
Windo
w
(
WidgetsBinding
.
instance
.
window
),
data:
MediaQueryData
.
from
Vie
w
(
WidgetsBinding
.
instance
.
window
),
child:
Localizations
(
child:
Localizations
(
locale:
const
Locale
(
'en'
,
'US'
),
locale:
const
Locale
(
'en'
,
'US'
),
delegates:
const
<
LocalizationsDelegate
<
dynamic
>>[
delegates:
const
<
LocalizationsDelegate
<
dynamic
>>[
...
@@ -1323,7 +1323,7 @@ class TestDependencies extends StatelessWidget {
...
@@ -1323,7 +1323,7 @@ class TestDependencies extends StatelessWidget {
return
Directionality
(
return
Directionality
(
textDirection:
TextDirection
.
ltr
,
textDirection:
TextDirection
.
ltr
,
child:
MediaQuery
(
child:
MediaQuery
(
data:
MediaQueryData
.
from
Window
(
WidgetsBinding
.
instance
.
window
),
data:
MediaQueryData
.
from
View
(
View
.
of
(
context
)
),
child:
child
,
child:
child
,
),
),
);
);
...
...
packages/flutter/test/material/popup_menu_test.dart
View file @
7a926dcb
...
@@ -3119,7 +3119,7 @@ class TestApp extends StatelessWidget {
...
@@ -3119,7 +3119,7 @@ class TestApp extends StatelessWidget {
DefaultMaterialLocalizations
.
delegate
,
DefaultMaterialLocalizations
.
delegate
,
],
],
child:
MediaQuery
(
child:
MediaQuery
(
data:
MediaQueryData
.
from
Window
(
WidgetsBinding
.
instance
.
window
),
data:
MediaQueryData
.
from
View
(
View
.
of
(
context
)
),
child:
Directionality
(
child:
Directionality
(
textDirection:
textDirection
,
textDirection:
textDirection
,
child:
Navigator
(
child:
Navigator
(
...
...
packages/flutter/test/material/range_slider_test.dart
View file @
7a926dcb
...
@@ -1658,7 +1658,7 @@ void main() {
...
@@ -1658,7 +1658,7 @@ void main() {
child:
StatefulBuilder
(
child:
StatefulBuilder
(
builder:
(
BuildContext
context
,
StateSetter
setState
)
{
builder:
(
BuildContext
context
,
StateSetter
setState
)
{
return
MediaQuery
(
return
MediaQuery
(
data:
MediaQueryData
.
fromWindow
(
WidgetsBinding
.
instance
.
window
).
copyWith
(
textScaleFactor:
2.0
),
data:
const
MediaQueryData
(
textScaleFactor:
2.0
),
child:
Material
(
child:
Material
(
child:
Center
(
child:
Center
(
child:
Theme
(
child:
Theme
(
...
...
packages/flutter/test/material/slider_theme_test.dart
View file @
7a926dcb
...
@@ -900,7 +900,7 @@ void main() {
...
@@ -900,7 +900,7 @@ void main() {
home:
Directionality
(
home:
Directionality
(
textDirection:
TextDirection
.
ltr
,
textDirection:
TextDirection
.
ltr
,
child:
MediaQuery
(
child:
MediaQuery
(
data:
MediaQueryData
.
fromWindow
(
WidgetsBinding
.
instance
.
window
).
copyWith
(
textScaleFactor:
textScale
),
data:
MediaQueryData
(
textScaleFactor:
textScale
),
child:
Material
(
child:
Material
(
child:
Row
(
child:
Row
(
children:
<
Widget
>[
children:
<
Widget
>[
...
@@ -1082,7 +1082,7 @@ void main() {
...
@@ -1082,7 +1082,7 @@ void main() {
home:
Directionality
(
home:
Directionality
(
textDirection:
TextDirection
.
ltr
,
textDirection:
TextDirection
.
ltr
,
child:
MediaQuery
(
child:
MediaQuery
(
data:
MediaQueryData
.
fromWindow
(
WidgetsBinding
.
instance
.
window
).
copyWith
(
textScaleFactor:
textScale
),
data:
MediaQueryData
(
textScaleFactor:
textScale
),
child:
Material
(
child:
Material
(
child:
Row
(
child:
Row
(
children:
<
Widget
>[
children:
<
Widget
>[
...
@@ -1870,7 +1870,7 @@ void main() {
...
@@ -1870,7 +1870,7 @@ void main() {
home:
Directionality
(
home:
Directionality
(
textDirection:
TextDirection
.
ltr
,
textDirection:
TextDirection
.
ltr
,
child:
MediaQuery
(
child:
MediaQuery
(
data:
MediaQueryData
.
fromWindow
(
WidgetsBinding
.
instance
.
window
).
copyWith
(
textScaleFactor:
textScale
),
data:
MediaQueryData
(
textScaleFactor:
textScale
),
child:
Material
(
child:
Material
(
child:
Row
(
child:
Row
(
children:
<
Widget
>[
children:
<
Widget
>[
...
@@ -2080,7 +2080,7 @@ void main() {
...
@@ -2080,7 +2080,7 @@ void main() {
home:
Directionality
(
home:
Directionality
(
textDirection:
TextDirection
.
ltr
,
textDirection:
TextDirection
.
ltr
,
child:
MediaQuery
(
child:
MediaQuery
(
data:
MediaQueryData
.
fromWindow
(
WidgetsBinding
.
instance
.
window
).
copyWith
(
textScaleFactor:
textScale
),
data:
MediaQueryData
(
textScaleFactor:
textScale
),
child:
Material
(
child:
Material
(
child:
Row
(
child:
Row
(
children:
<
Widget
>[
children:
<
Widget
>[
...
...
packages/flutter/test/material/text_field_test.dart
View file @
7a926dcb
...
@@ -7845,7 +7845,7 @@ void main() {
...
@@ -7845,7 +7845,7 @@ void main() {
MaterialApp
(
MaterialApp
(
home:
Scaffold
(
home:
Scaffold
(
body:
MediaQuery
(
body:
MediaQuery
(
data:
MediaQueryData
.
fromWindow
(
WidgetsBinding
.
instance
.
window
).
copyWith
(
textScaleFactor:
4.0
),
data:
const
MediaQueryData
(
textScaleFactor:
4.0
),
child:
Center
(
child:
Center
(
child:
TextField
(
child:
TextField
(
decoration:
const
InputDecoration
(
labelText:
'Label'
,
border:
UnderlineInputBorder
()),
decoration:
const
InputDecoration
(
labelText:
'Label'
,
border:
UnderlineInputBorder
()),
...
...
packages/flutter/test/material/tooltip_test.dart
View file @
7a926dcb
...
@@ -476,15 +476,13 @@ void main() {
...
@@ -476,15 +476,13 @@ void main() {
child:
const
Icon
(
Icons
.
add
),
child:
const
Icon
(
Icons
.
add
),
),
),
);
);
return
MediaQuery
.
fromWindow
(
return
MediaQuery
(
child:
MediaQuery
(
data:
MediaQueryData
(
data:
MediaQueryData
(
viewInsets:
EdgeInsets
.
only
(
bottom:
viewInsetsHeight
),
viewInsets:
EdgeInsets
.
only
(
bottom:
viewInsetsHeight
),
),
),
child:
MaterialApp
(
child:
MaterialApp
(
useInheritedMediaQuery:
true
,
useInheritedMediaQuery:
true
,
home:
scaffold
,
home:
scaffold
,
),
),
),
);
);
}
}
...
...
packages/flutter/test/widgets/display_feature_sub_screen_test.dart
View file @
7a926dcb
...
@@ -11,7 +11,7 @@ void main() {
...
@@ -11,7 +11,7 @@ void main() {
group
(
'DisplayFeatureSubScreen'
,
()
{
group
(
'DisplayFeatureSubScreen'
,
()
{
testWidgets
(
'without Directionality or anchor'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'without Directionality or anchor'
,
(
WidgetTester
tester
)
async
{
const
Key
childKey
=
Key
(
'childKey'
);
const
Key
childKey
=
Key
(
'childKey'
);
final
MediaQueryData
mediaQuery
=
MediaQueryData
.
from
Windo
w
(
WidgetsBinding
.
instance
.
window
).
copyWith
(
final
MediaQueryData
mediaQuery
=
MediaQueryData
.
from
Vie
w
(
WidgetsBinding
.
instance
.
window
).
copyWith
(
displayFeatures:
<
DisplayFeature
>[
displayFeatures:
<
DisplayFeature
>[
const
DisplayFeature
(
const
DisplayFeature
(
bounds:
Rect
.
fromLTRB
(
390
,
0
,
410
,
600
),
bounds:
Rect
.
fromLTRB
(
390
,
0
,
410
,
600
),
...
@@ -39,7 +39,7 @@ void main() {
...
@@ -39,7 +39,7 @@ void main() {
testWidgets
(
'with anchorPoint'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'with anchorPoint'
,
(
WidgetTester
tester
)
async
{
const
Key
childKey
=
Key
(
'childKey'
);
const
Key
childKey
=
Key
(
'childKey'
);
final
MediaQueryData
mediaQuery
=
MediaQueryData
.
from
Windo
w
(
WidgetsBinding
.
instance
.
window
).
copyWith
(
final
MediaQueryData
mediaQuery
=
MediaQueryData
.
from
Vie
w
(
WidgetsBinding
.
instance
.
window
).
copyWith
(
displayFeatures:
<
DisplayFeature
>[
displayFeatures:
<
DisplayFeature
>[
const
DisplayFeature
(
const
DisplayFeature
(
bounds:
Rect
.
fromLTRB
(
390
,
0
,
410
,
600
),
bounds:
Rect
.
fromLTRB
(
390
,
0
,
410
,
600
),
...
@@ -70,7 +70,7 @@ void main() {
...
@@ -70,7 +70,7 @@ void main() {
testWidgets
(
'with infinity anchorpoint'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'with infinity anchorpoint'
,
(
WidgetTester
tester
)
async
{
const
Key
childKey
=
Key
(
'childKey'
);
const
Key
childKey
=
Key
(
'childKey'
);
final
MediaQueryData
mediaQuery
=
MediaQueryData
.
from
Windo
w
(
WidgetsBinding
.
instance
.
window
).
copyWith
(
final
MediaQueryData
mediaQuery
=
MediaQueryData
.
from
Vie
w
(
WidgetsBinding
.
instance
.
window
).
copyWith
(
displayFeatures:
<
DisplayFeature
>[
displayFeatures:
<
DisplayFeature
>[
const
DisplayFeature
(
const
DisplayFeature
(
bounds:
Rect
.
fromLTRB
(
390
,
0
,
410
,
600
),
bounds:
Rect
.
fromLTRB
(
390
,
0
,
410
,
600
),
...
@@ -101,7 +101,7 @@ void main() {
...
@@ -101,7 +101,7 @@ void main() {
testWidgets
(
'with horizontal hinge and anchorPoint'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'with horizontal hinge and anchorPoint'
,
(
WidgetTester
tester
)
async
{
const
Key
childKey
=
Key
(
'childKey'
);
const
Key
childKey
=
Key
(
'childKey'
);
final
MediaQueryData
mediaQuery
=
MediaQueryData
.
from
Windo
w
(
WidgetsBinding
.
instance
.
window
).
copyWith
(
final
MediaQueryData
mediaQuery
=
MediaQueryData
.
from
Vie
w
(
WidgetsBinding
.
instance
.
window
).
copyWith
(
displayFeatures:
<
DisplayFeature
>[
displayFeatures:
<
DisplayFeature
>[
const
DisplayFeature
(
const
DisplayFeature
(
bounds:
Rect
.
fromLTRB
(
0
,
290
,
800
,
310
),
bounds:
Rect
.
fromLTRB
(
0
,
290
,
800
,
310
),
...
@@ -131,7 +131,7 @@ void main() {
...
@@ -131,7 +131,7 @@ void main() {
testWidgets
(
'with multiple display features and anchorPoint'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'with multiple display features and anchorPoint'
,
(
WidgetTester
tester
)
async
{
const
Key
childKey
=
Key
(
'childKey'
);
const
Key
childKey
=
Key
(
'childKey'
);
final
MediaQueryData
mediaQuery
=
MediaQueryData
.
from
Windo
w
(
WidgetsBinding
.
instance
.
window
).
copyWith
(
final
MediaQueryData
mediaQuery
=
MediaQueryData
.
from
Vie
w
(
WidgetsBinding
.
instance
.
window
).
copyWith
(
displayFeatures:
<
DisplayFeature
>[
displayFeatures:
<
DisplayFeature
>[
const
DisplayFeature
(
const
DisplayFeature
(
bounds:
Rect
.
fromLTRB
(
0
,
290
,
800
,
310
),
bounds:
Rect
.
fromLTRB
(
0
,
290
,
800
,
310
),
...
@@ -166,7 +166,7 @@ void main() {
...
@@ -166,7 +166,7 @@ void main() {
testWidgets
(
'with non-splitting display features and anchorPoint'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'with non-splitting display features and anchorPoint'
,
(
WidgetTester
tester
)
async
{
const
Key
childKey
=
Key
(
'childKey'
);
const
Key
childKey
=
Key
(
'childKey'
);
final
MediaQueryData
mediaQuery
=
MediaQueryData
.
from
Windo
w
(
WidgetsBinding
.
instance
.
window
).
copyWith
(
final
MediaQueryData
mediaQuery
=
MediaQueryData
.
from
Vie
w
(
WidgetsBinding
.
instance
.
window
).
copyWith
(
displayFeatures:
<
DisplayFeature
>[
displayFeatures:
<
DisplayFeature
>[
// Top notch
// Top notch
const
DisplayFeature
(
const
DisplayFeature
(
...
@@ -211,7 +211,7 @@ void main() {
...
@@ -211,7 +211,7 @@ void main() {
testWidgets
(
'with size 0 display feature in half-opened posture and anchorPoint'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'with size 0 display feature in half-opened posture and anchorPoint'
,
(
WidgetTester
tester
)
async
{
const
Key
childKey
=
Key
(
'childKey'
);
const
Key
childKey
=
Key
(
'childKey'
);
final
MediaQueryData
mediaQuery
=
MediaQueryData
.
from
Windo
w
(
WidgetsBinding
.
instance
.
window
).
copyWith
(
final
MediaQueryData
mediaQuery
=
MediaQueryData
.
from
Vie
w
(
WidgetsBinding
.
instance
.
window
).
copyWith
(
displayFeatures:
<
DisplayFeature
>[
displayFeatures:
<
DisplayFeature
>[
const
DisplayFeature
(
const
DisplayFeature
(
bounds:
Rect
.
fromLTRB
(
0
,
300
,
800
,
300
),
bounds:
Rect
.
fromLTRB
(
0
,
300
,
800
,
300
),
...
...
packages/flutter/test/widgets/heroes_test.dart
View file @
7a926dcb
...
@@ -3168,7 +3168,7 @@ class TestDependencies extends StatelessWidget {
...
@@ -3168,7 +3168,7 @@ class TestDependencies extends StatelessWidget {
return
Directionality
(
return
Directionality
(
textDirection:
TextDirection
.
ltr
,
textDirection:
TextDirection
.
ltr
,
child:
MediaQuery
(
child:
MediaQuery
(
data:
MediaQueryData
.
from
Window
(
WidgetsBinding
.
instance
.
window
),
data:
MediaQueryData
.
from
View
(
View
.
of
(
context
)
),
child:
child
,
child:
child
,
),
),
);
);
...
...
packages/flutter/test/widgets/media_query_test.dart
View file @
7a926dcb
...
@@ -145,11 +145,11 @@ void main() {
...
@@ -145,11 +145,11 @@ void main() {
expect
(
tested
,
isTrue
);
expect
(
tested
,
isTrue
);
});
});
testWidgets
(
'MediaQueryData.from
Windo
w is sane'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'MediaQueryData.from
Vie
w is sane'
,
(
WidgetTester
tester
)
async
{
final
MediaQueryData
data
=
MediaQueryData
.
from
Window
(
WidgetsBinding
.
instance
.
window
);
final
MediaQueryData
data
=
MediaQueryData
.
from
View
(
tester
.
binding
.
window
);
expect
(
data
,
hasOneLineDescription
);
expect
(
data
,
hasOneLineDescription
);
expect
(
data
.
hashCode
,
equals
(
data
.
copyWith
().
hashCode
));
expect
(
data
.
hashCode
,
equals
(
data
.
copyWith
().
hashCode
));
expect
(
data
.
size
,
equals
(
WidgetsBinding
.
instance
.
window
.
physicalSize
/
WidgetsBinding
.
instance
.
window
.
devicePixelRatio
));
expect
(
data
.
size
,
equals
(
tester
.
binding
.
window
.
physicalSize
/
tester
.
binding
.
window
.
devicePixelRatio
));
expect
(
data
.
accessibleNavigation
,
false
);
expect
(
data
.
accessibleNavigation
,
false
);
expect
(
data
.
invertColors
,
false
);
expect
(
data
.
invertColors
,
false
);
expect
(
data
.
disableAnimations
,
false
);
expect
(
data
.
disableAnimations
,
false
);
...
@@ -513,7 +513,7 @@ void main() {
...
@@ -513,7 +513,7 @@ void main() {
});
});
testWidgets
(
'MediaQueryData.copyWith defaults to source'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'MediaQueryData.copyWith defaults to source'
,
(
WidgetTester
tester
)
async
{
final
MediaQueryData
data
=
MediaQueryData
.
from
Window
(
WidgetsBinding
.
instance
.
window
);
final
MediaQueryData
data
=
MediaQueryData
.
from
View
(
tester
.
binding
.
window
);
final
MediaQueryData
copied
=
data
.
copyWith
();
final
MediaQueryData
copied
=
data
.
copyWith
();
expect
(
copied
.
size
,
data
.
size
);
expect
(
copied
.
size
,
data
.
size
);
expect
(
copied
.
devicePixelRatio
,
data
.
devicePixelRatio
);
expect
(
copied
.
devicePixelRatio
,
data
.
devicePixelRatio
);
...
@@ -552,7 +552,7 @@ void main() {
...
@@ -552,7 +552,7 @@ void main() {
),
),
];
];
final
MediaQueryData
data
=
MediaQueryData
.
from
Window
(
WidgetsBinding
.
instance
.
window
);
final
MediaQueryData
data
=
MediaQueryData
.
from
View
(
tester
.
binding
.
window
);
final
MediaQueryData
copied
=
data
.
copyWith
(
final
MediaQueryData
copied
=
data
.
copyWith
(
size:
customSize
,
size:
customSize
,
devicePixelRatio:
customDevicePixelRatio
,
devicePixelRatio:
customDevicePixelRatio
,
...
@@ -1110,7 +1110,7 @@ void main() {
...
@@ -1110,7 +1110,7 @@ void main() {
expect
(
insideBoldTextOverride
,
true
);
expect
(
insideBoldTextOverride
,
true
);
});
});
testWidgets
(
'MediaQuery.from
Windo
w creates a MediaQuery'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'MediaQuery.from
Vie
w creates a MediaQuery'
,
(
WidgetTester
tester
)
async
{
MediaQuery
?
mediaQueryOutside
;
MediaQuery
?
mediaQueryOutside
;
MediaQuery
?
mediaQueryInside
;
MediaQuery
?
mediaQueryInside
;
...
@@ -1118,7 +1118,8 @@ void main() {
...
@@ -1118,7 +1118,8 @@ void main() {
Builder
(
Builder
(
builder:
(
BuildContext
context
)
{
builder:
(
BuildContext
context
)
{
mediaQueryOutside
=
context
.
findAncestorWidgetOfExactType
<
MediaQuery
>();
mediaQueryOutside
=
context
.
findAncestorWidgetOfExactType
<
MediaQuery
>();
return
MediaQuery
.
fromWindow
(
return
MediaQuery
.
fromView
(
view:
View
.
of
(
context
),
child:
Builder
(
child:
Builder
(
builder:
(
BuildContext
context
)
{
builder:
(
BuildContext
context
)
{
mediaQueryInside
=
context
.
findAncestorWidgetOfExactType
<
MediaQuery
>();
mediaQueryInside
=
context
.
findAncestorWidgetOfExactType
<
MediaQuery
>();
...
@@ -1135,7 +1136,7 @@ void main() {
...
@@ -1135,7 +1136,7 @@ void main() {
});
});
testWidgets
(
'MediaQueryData.fromWindow is created using window values'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'MediaQueryData.fromWindow is created using window values'
,
(
WidgetTester
tester
)
async
{
final
MediaQueryData
windowData
=
MediaQueryData
.
fromWindow
(
WidgetsBinding
.
instance
.
window
);
final
MediaQueryData
windowData
=
MediaQueryData
.
fromWindow
(
tester
.
binding
.
window
);
late
MediaQueryData
fromWindowData
;
late
MediaQueryData
fromWindowData
;
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
...
@@ -1329,7 +1330,7 @@ void main() {
...
@@ -1329,7 +1330,7 @@ void main() {
gestureSettings:
GestureSettings
(
physicalDoubleTapSlop:
100
,
physicalTouchSlop:
100
),
gestureSettings:
GestureSettings
(
physicalDoubleTapSlop:
100
,
physicalTouchSlop:
100
),
);
);
expect
(
MediaQueryData
.
from
Windo
w
(
tester
.
binding
.
window
).
gestureSettings
.
touchSlop
,
closeTo
(
33.33
,
0.1
));
// Repeating, of course
expect
(
MediaQueryData
.
from
Vie
w
(
tester
.
binding
.
window
).
gestureSettings
.
touchSlop
,
closeTo
(
33.33
,
0.1
));
// Repeating, of course
tester
.
binding
.
window
.
viewConfigurationTestValue
=
null
;
tester
.
binding
.
window
.
viewConfigurationTestValue
=
null
;
});
});
...
...
packages/flutter/test/widgets/navigator_restoration_test.dart
View file @
7a926dcb
...
@@ -1047,7 +1047,7 @@ class PagedTestWidget extends StatelessWidget {
...
@@ -1047,7 +1047,7 @@ class PagedTestWidget extends StatelessWidget {
child:
Directionality
(
child:
Directionality
(
textDirection:
TextDirection
.
ltr
,
textDirection:
TextDirection
.
ltr
,
child:
MediaQuery
(
child:
MediaQuery
(
data:
MediaQueryData
.
from
Window
(
WidgetsBinding
.
instance
.
window
),
data:
MediaQueryData
.
from
View
(
View
.
of
(
context
)
),
child:
const
PagedTestNavigator
(),
child:
const
PagedTestNavigator
(),
),
),
),
),
...
@@ -1173,7 +1173,7 @@ class TestWidget extends StatelessWidget {
...
@@ -1173,7 +1173,7 @@ class TestWidget extends StatelessWidget {
child:
Directionality
(
child:
Directionality
(
textDirection:
TextDirection
.
ltr
,
textDirection:
TextDirection
.
ltr
,
child:
MediaQuery
(
child:
MediaQuery
(
data:
MediaQueryData
.
from
Window
(
WidgetsBinding
.
instance
.
window
),
data:
MediaQueryData
.
from
View
(
View
.
of
(
context
)
),
child:
Navigator
(
child:
Navigator
(
initialRoute:
'home'
,
initialRoute:
'home'
,
restorationScopeId:
'app'
,
restorationScopeId:
'app'
,
...
...
packages/flutter/test/widgets/navigator_test.dart
View file @
7a926dcb
...
@@ -204,7 +204,7 @@ void main() {
...
@@ -204,7 +204,7 @@ void main() {
const
MaterialPage
<
void
>
page
=
MaterialPage
<
void
>(
child:
Text
(
'page'
));
const
MaterialPage
<
void
>
page
=
MaterialPage
<
void
>(
child:
Text
(
'page'
));
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
MediaQuery
(
MediaQuery
(
data:
MediaQueryData
.
from
Window
(
WidgetsBinding
.
instance
.
window
),
data:
MediaQueryData
.
from
View
(
tester
.
binding
.
window
),
child:
Directionality
(
child:
Directionality
(
textDirection:
TextDirection
.
ltr
,
textDirection:
TextDirection
.
ltr
,
child:
Navigator
(
child:
Navigator
(
...
@@ -219,7 +219,7 @@ void main() {
...
@@ -219,7 +219,7 @@ void main() {
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
MediaQuery
(
MediaQuery
(
data:
MediaQueryData
.
from
Window
(
WidgetsBinding
.
instance
.
window
),
data:
MediaQueryData
.
from
View
(
tester
.
binding
.
window
),
child:
Directionality
(
child:
Directionality
(
textDirection:
TextDirection
.
ltr
,
textDirection:
TextDirection
.
ltr
,
child:
Navigator
(
child:
Navigator
(
...
@@ -2684,7 +2684,7 @@ void main() {
...
@@ -2684,7 +2684,7 @@ void main() {
List
<
NavigatorObserver
>
observers
=
const
<
NavigatorObserver
>[],
List
<
NavigatorObserver
>
observers
=
const
<
NavigatorObserver
>[],
})
{
})
{
return
MediaQuery
(
return
MediaQuery
(
data:
MediaQueryData
.
from
Windo
w
(
WidgetsBinding
.
instance
.
window
),
data:
MediaQueryData
.
from
Vie
w
(
WidgetsBinding
.
instance
.
window
),
child:
Localizations
(
child:
Localizations
(
locale:
const
Locale
(
'en'
,
'US'
),
locale:
const
Locale
(
'en'
,
'US'
),
delegates:
const
<
LocalizationsDelegate
<
dynamic
>>[
delegates:
const
<
LocalizationsDelegate
<
dynamic
>>[
...
@@ -2782,7 +2782,7 @@ void main() {
...
@@ -2782,7 +2782,7 @@ void main() {
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
MediaQuery
(
MediaQuery
(
data:
MediaQueryData
.
from
Window
(
WidgetsBinding
.
instance
.
window
),
data:
MediaQueryData
.
from
View
(
tester
.
binding
.
window
),
child:
Localizations
(
child:
Localizations
(
locale:
const
Locale
(
'en'
,
'US'
),
locale:
const
Locale
(
'en'
,
'US'
),
delegates:
const
<
LocalizationsDelegate
<
dynamic
>>[
delegates:
const
<
LocalizationsDelegate
<
dynamic
>>[
...
@@ -2821,7 +2821,7 @@ void main() {
...
@@ -2821,7 +2821,7 @@ void main() {
};
};
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
MediaQuery
(
MediaQuery
(
data:
MediaQueryData
.
from
Window
(
WidgetsBinding
.
instance
.
window
),
data:
MediaQueryData
.
from
View
(
tester
.
binding
.
window
),
child:
Localizations
(
child:
Localizations
(
locale:
const
Locale
(
'en'
,
'US'
),
locale:
const
Locale
(
'en'
,
'US'
),
delegates:
const
<
LocalizationsDelegate
<
dynamic
>>[
delegates:
const
<
LocalizationsDelegate
<
dynamic
>>[
...
@@ -4271,7 +4271,7 @@ class TestDependencies extends StatelessWidget {
...
@@ -4271,7 +4271,7 @@ class TestDependencies extends StatelessWidget {
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
return
MediaQuery
(
return
MediaQuery
(
data:
MediaQueryData
.
from
Window
(
WidgetsBinding
.
instance
.
window
),
data:
MediaQueryData
.
from
View
(
View
.
of
(
context
)
),
child:
Directionality
(
child:
Directionality
(
textDirection:
TextDirection
.
ltr
,
textDirection:
TextDirection
.
ltr
,
child:
child
,
child:
child
,
...
...
packages/flutter/test/widgets/page_view_test.dart
View file @
7a926dcb
...
@@ -142,7 +142,7 @@ void main() {
...
@@ -142,7 +142,7 @@ void main() {
// Set the starting viewportDimension to 0.0
// Set the starting viewportDimension to 0.0
await
tester
.
binding
.
setSurfaceSize
(
Size
.
zero
);
await
tester
.
binding
.
setSurfaceSize
(
Size
.
zero
);
final
MediaQueryData
mediaQueryData
=
MediaQueryData
.
from
Windo
w
(
tester
.
binding
.
window
);
final
MediaQueryData
mediaQueryData
=
MediaQueryData
.
from
Vie
w
(
tester
.
binding
.
window
);
Widget
build
(
Size
size
)
{
Widget
build
(
Size
size
)
{
return
MediaQuery
(
return
MediaQuery
(
...
...
packages/flutter/test/widgets/reparent_state_with_layout_builder_test.dart
View file @
7a926dcb
...
@@ -96,7 +96,7 @@ void main() {
...
@@ -96,7 +96,7 @@ void main() {
Widget
deepChild
=
Container
();
Widget
deepChild
=
Container
();
await
tester
.
pumpWidget
(
MediaQuery
(
await
tester
.
pumpWidget
(
MediaQuery
(
data:
MediaQueryData
.
from
Window
(
WidgetsBinding
.
instance
.
window
),
data:
MediaQueryData
.
from
View
(
tester
.
binding
.
window
),
child:
Column
(
child:
Column
(
children:
<
Widget
>[
children:
<
Widget
>[
StatefulBuilder
(
builder:
(
BuildContext
context
,
StateSetter
setState
)
{
StatefulBuilder
(
builder:
(
BuildContext
context
,
StateSetter
setState
)
{
...
...
packages/flutter/test/widgets/scroll_position_test.dart
View file @
7a926dcb
...
@@ -34,7 +34,7 @@ Future<void> performTest(WidgetTester tester, bool maintainState) async {
...
@@ -34,7 +34,7 @@ Future<void> performTest(WidgetTester tester, bool maintainState) async {
Directionality
(
Directionality
(
textDirection:
TextDirection
.
ltr
,
textDirection:
TextDirection
.
ltr
,
child:
MediaQuery
(
child:
MediaQuery
(
data:
MediaQueryData
.
from
Window
(
WidgetsBinding
.
instance
.
window
),
data:
MediaQueryData
.
from
View
(
tester
.
binding
.
window
),
child:
Navigator
(
child:
Navigator
(
key:
navigatorKey
,
key:
navigatorKey
,
onGenerateRoute:
(
RouteSettings
settings
)
{
onGenerateRoute:
(
RouteSettings
settings
)
{
...
...
packages/flutter/test/widgets/semantics_debugger_test.dart
View file @
7a926dcb
...
@@ -301,7 +301,7 @@ void main() {
...
@@ -301,7 +301,7 @@ void main() {
child:
Directionality
(
child:
Directionality
(
textDirection:
TextDirection
.
ltr
,
textDirection:
TextDirection
.
ltr
,
child:
MediaQuery
(
child:
MediaQuery
(
data:
MediaQueryData
.
from
Window
(
WidgetsBinding
.
instance
.
window
),
data:
MediaQueryData
.
from
View
(
tester
.
binding
.
window
),
child:
Material
(
child:
Material
(
child:
Center
(
child:
Center
(
child:
Slider
(
child:
Slider
(
...
...
packages/flutter/test/widgets/snapshot_widget_test.dart
View file @
7a926dcb
...
@@ -371,8 +371,7 @@ class TestDependencies extends StatelessWidget {
...
@@ -371,8 +371,7 @@ class TestDependencies extends StatelessWidget {
return
Directionality
(
return
Directionality
(
textDirection:
TextDirection
.
ltr
,
textDirection:
TextDirection
.
ltr
,
child:
MediaQuery
(
child:
MediaQuery
(
data:
MediaQueryData
.
fromWindow
(
WidgetsBinding
.
instance
.
window
)
data:
const
MediaQueryData
().
copyWith
(
devicePixelRatio:
devicePixelRatio
),
.
copyWith
(
devicePixelRatio:
devicePixelRatio
),
child:
child
,
child:
child
,
),
),
);
);
...
...
packages/flutter/test_fixes/widgets/widgets.dart
View file @
7a926dcb
...
@@ -12,7 +12,10 @@ void main() {
...
@@ -12,7 +12,10 @@ void main() {
Object
object
;
Object
object
;
TickerProvider
vsync
;
TickerProvider
vsync
;
// Changes made in https://github.com/flutter/flutter/pull/119186 and https://github.com/flutter/flutter/pull/81067.
// Changes made in https://github.com/flutter/flutter/pull/119647
MediaQueryData
.
fromWindow
(
View
.
of
(
context
));
// Changes made in https://github.com/flutter/flutter/pull/119186 and https://github.com/flutter/flutter/pull/81067
AnimatedSize
(
vsync:
vsync
,
duration:
Duration
.
zero
);
AnimatedSize
(
vsync:
vsync
,
duration:
Duration
.
zero
);
// Changes made in https://github.com/flutter/flutter/pull/45941 and https://github.com/flutter/flutter/pull/83843
// Changes made in https://github.com/flutter/flutter/pull/45941 and https://github.com/flutter/flutter/pull/83843
...
...
packages/flutter/test_fixes/widgets/widgets.dart.expect
View file @
7a926dcb
...
@@ -12,7 +12,10 @@ void main() {
...
@@ -12,7 +12,10 @@ void main() {
Object object;
Object object;
TickerProvider vsync;
TickerProvider vsync;
// Changes made in https://github.com/flutter/flutter/pull/119186 and https://github.com/flutter/flutter/pull/81067.
// Changes made in https://github.com/flutter/flutter/pull/119647
MediaQueryData.fromView(View.of(context));
// Changes made in https://github.com/flutter/flutter/pull/119186 and https://github.com/flutter/flutter/pull/81067
AnimatedSize(duration: Duration.zero);
AnimatedSize(duration: Duration.zero);
// Changes made in https://github.com/flutter/flutter/pull/45941 and https://github.com/flutter/flutter/pull/83843
// Changes made in https://github.com/flutter/flutter/pull/45941 and https://github.com/flutter/flutter/pull/83843
...
...
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