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
db48cadd
Unverified
Commit
db48cadd
authored
Jun 24, 2020
by
David Worsham
Committed by
GitHub
Jun 24, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unused physicalDepth code (#60152)
parent
9e30d51a
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
0 additions
and
68 deletions
+0
-68
media_query.dart
packages/flutter/lib/src/widgets/media_query.dart
+0
-21
media_query_test.dart
packages/flutter/test/widgets/media_query_test.dart
+0
-16
window.dart
packages/flutter_test/lib/src/window.dart
+0
-17
window_test.dart
packages/flutter_test/test/window_test.dart
+0
-14
No files found.
packages/flutter/lib/src/widgets/media_query.dart
View file @
db48cadd
...
@@ -97,7 +97,6 @@ class MediaQueryData {
...
@@ -97,7 +97,6 @@ class MediaQueryData {
this
.
viewInsets
=
EdgeInsets
.
zero
,
this
.
viewInsets
=
EdgeInsets
.
zero
,
this
.
systemGestureInsets
=
EdgeInsets
.
zero
,
this
.
systemGestureInsets
=
EdgeInsets
.
zero
,
this
.
viewPadding
=
EdgeInsets
.
zero
,
this
.
viewPadding
=
EdgeInsets
.
zero
,
this
.
physicalDepth
=
double
.
maxFinite
,
this
.
alwaysUse24HourFormat
=
false
,
this
.
alwaysUse24HourFormat
=
false
,
this
.
accessibleNavigation
=
false
,
this
.
accessibleNavigation
=
false
,
this
.
invertColors
=
false
,
this
.
invertColors
=
false
,
...
@@ -113,7 +112,6 @@ class MediaQueryData {
...
@@ -113,7 +112,6 @@ class MediaQueryData {
assert
(
viewInsets
!=
null
),
assert
(
viewInsets
!=
null
),
assert
(
systemGestureInsets
!=
null
),
assert
(
systemGestureInsets
!=
null
),
assert
(
viewPadding
!=
null
),
assert
(
viewPadding
!=
null
),
assert
(
physicalDepth
!=
null
),
assert
(
alwaysUse24HourFormat
!=
null
),
assert
(
alwaysUse24HourFormat
!=
null
),
assert
(
accessibleNavigation
!=
null
),
assert
(
accessibleNavigation
!=
null
),
assert
(
invertColors
!=
null
),
assert
(
invertColors
!=
null
),
...
@@ -137,7 +135,6 @@ class MediaQueryData {
...
@@ -137,7 +135,6 @@ class MediaQueryData {
viewPadding
=
EdgeInsets
.
fromWindowPadding
(
window
.
viewPadding
,
window
.
devicePixelRatio
),
viewPadding
=
EdgeInsets
.
fromWindowPadding
(
window
.
viewPadding
,
window
.
devicePixelRatio
),
viewInsets
=
EdgeInsets
.
fromWindowPadding
(
window
.
viewInsets
,
window
.
devicePixelRatio
),
viewInsets
=
EdgeInsets
.
fromWindowPadding
(
window
.
viewInsets
,
window
.
devicePixelRatio
),
systemGestureInsets
=
EdgeInsets
.
fromWindowPadding
(
window
.
systemGestureInsets
,
window
.
devicePixelRatio
),
systemGestureInsets
=
EdgeInsets
.
fromWindowPadding
(
window
.
systemGestureInsets
,
window
.
devicePixelRatio
),
physicalDepth
=
window
.
physicalDepth
,
accessibleNavigation
=
window
.
accessibilityFeatures
.
accessibleNavigation
,
accessibleNavigation
=
window
.
accessibilityFeatures
.
accessibleNavigation
,
invertColors
=
window
.
accessibilityFeatures
.
invertColors
,
invertColors
=
window
.
accessibilityFeatures
.
invertColors
,
disableAnimations
=
window
.
accessibilityFeatures
.
disableAnimations
,
disableAnimations
=
window
.
accessibilityFeatures
.
disableAnimations
,
...
@@ -291,19 +288,6 @@ class MediaQueryData {
...
@@ -291,19 +288,6 @@ class MediaQueryData {
/// {@end-tool}
/// {@end-tool}
final
EdgeInsets
systemGestureInsets
;
final
EdgeInsets
systemGestureInsets
;
/// The physical depth is the maximum elevation that the Window allows.
///
/// Physical layers drawn at or above this elevation will have their elevation
/// clamped to this value. This can happen if the physical layer itself has
/// an elevation larger than the available depth, or if some ancestor of the
/// layer causes it to have a cumulative elevation that is larger than the
/// available depth.
///
/// The default value is [double.maxFinite], which is used for platforms that
/// do not specify a maximum elevation. This property is currently only
/// expected to be set to a non-default value on Fuchsia.
final
double
physicalDepth
;
/// Whether to use 24-hour format when formatting time.
/// Whether to use 24-hour format when formatting time.
///
///
/// The behavior of this flag is different across platforms:
/// The behavior of this flag is different across platforms:
...
@@ -394,7 +378,6 @@ class MediaQueryData {
...
@@ -394,7 +378,6 @@ class MediaQueryData {
EdgeInsets
viewPadding
,
EdgeInsets
viewPadding
,
EdgeInsets
viewInsets
,
EdgeInsets
viewInsets
,
EdgeInsets
systemGestureInsets
,
EdgeInsets
systemGestureInsets
,
double
physicalDepth
,
bool
alwaysUse24HourFormat
,
bool
alwaysUse24HourFormat
,
bool
highContrast
,
bool
highContrast
,
bool
disableAnimations
,
bool
disableAnimations
,
...
@@ -412,7 +395,6 @@ class MediaQueryData {
...
@@ -412,7 +395,6 @@ class MediaQueryData {
viewPadding:
viewPadding
??
this
.
viewPadding
,
viewPadding:
viewPadding
??
this
.
viewPadding
,
viewInsets:
viewInsets
??
this
.
viewInsets
,
viewInsets:
viewInsets
??
this
.
viewInsets
,
systemGestureInsets:
systemGestureInsets
??
this
.
systemGestureInsets
,
systemGestureInsets:
systemGestureInsets
??
this
.
systemGestureInsets
,
physicalDepth:
physicalDepth
??
this
.
physicalDepth
,
alwaysUse24HourFormat:
alwaysUse24HourFormat
??
this
.
alwaysUse24HourFormat
,
alwaysUse24HourFormat:
alwaysUse24HourFormat
??
this
.
alwaysUse24HourFormat
,
invertColors:
invertColors
??
this
.
invertColors
,
invertColors:
invertColors
??
this
.
invertColors
,
highContrast:
highContrast
??
this
.
highContrast
,
highContrast:
highContrast
??
this
.
highContrast
,
...
@@ -581,7 +563,6 @@ class MediaQueryData {
...
@@ -581,7 +563,6 @@ class MediaQueryData {
&&
other
.
padding
==
padding
&&
other
.
padding
==
padding
&&
other
.
viewPadding
==
viewPadding
&&
other
.
viewPadding
==
viewPadding
&&
other
.
viewInsets
==
viewInsets
&&
other
.
viewInsets
==
viewInsets
&&
other
.
physicalDepth
==
physicalDepth
&&
other
.
alwaysUse24HourFormat
==
alwaysUse24HourFormat
&&
other
.
alwaysUse24HourFormat
==
alwaysUse24HourFormat
&&
other
.
highContrast
==
highContrast
&&
other
.
highContrast
==
highContrast
&&
other
.
disableAnimations
==
disableAnimations
&&
other
.
disableAnimations
==
disableAnimations
...
@@ -601,7 +582,6 @@ class MediaQueryData {
...
@@ -601,7 +582,6 @@ class MediaQueryData {
padding
,
padding
,
viewPadding
,
viewPadding
,
viewInsets
,
viewInsets
,
physicalDepth
,
alwaysUse24HourFormat
,
alwaysUse24HourFormat
,
highContrast
,
highContrast
,
disableAnimations
,
disableAnimations
,
...
@@ -622,7 +602,6 @@ class MediaQueryData {
...
@@ -622,7 +602,6 @@ class MediaQueryData {
'padding:
$padding
'
,
'padding:
$padding
'
,
'viewPadding:
$viewPadding
'
,
'viewPadding:
$viewPadding
'
,
'viewInsets:
$viewInsets
'
,
'viewInsets:
$viewInsets
'
,
'physicalDepth:
$physicalDepth
'
,
'alwaysUse24HourFormat:
$alwaysUse24HourFormat
'
,
'alwaysUse24HourFormat:
$alwaysUse24HourFormat
'
,
'accessibleNavigation:
$accessibleNavigation
'
,
'accessibleNavigation:
$accessibleNavigation
'
,
'highContrast:
$highContrast
'
,
'highContrast:
$highContrast
'
,
...
...
packages/flutter/test/widgets/media_query_test.dart
View file @
db48cadd
...
@@ -71,7 +71,6 @@ void main() {
...
@@ -71,7 +71,6 @@ void main() {
expect
(
data
.
boldText
,
false
);
expect
(
data
.
boldText
,
false
);
expect
(
data
.
highContrast
,
false
);
expect
(
data
.
highContrast
,
false
);
expect
(
data
.
platformBrightness
,
Brightness
.
light
);
expect
(
data
.
platformBrightness
,
Brightness
.
light
);
expect
(
data
.
physicalDepth
,
equals
(
WidgetsBinding
.
instance
.
window
.
physicalDepth
));
});
});
testWidgets
(
'MediaQueryData.copyWith defaults to source'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'MediaQueryData.copyWith defaults to source'
,
(
WidgetTester
tester
)
async
{
...
@@ -84,7 +83,6 @@ void main() {
...
@@ -84,7 +83,6 @@ void main() {
expect
(
copied
.
viewPadding
,
data
.
viewPadding
);
expect
(
copied
.
viewPadding
,
data
.
viewPadding
);
expect
(
copied
.
viewInsets
,
data
.
viewInsets
);
expect
(
copied
.
viewInsets
,
data
.
viewInsets
);
expect
(
copied
.
systemGestureInsets
,
data
.
systemGestureInsets
);
expect
(
copied
.
systemGestureInsets
,
data
.
systemGestureInsets
);
expect
(
copied
.
physicalDepth
,
data
.
physicalDepth
);
expect
(
copied
.
alwaysUse24HourFormat
,
data
.
alwaysUse24HourFormat
);
expect
(
copied
.
alwaysUse24HourFormat
,
data
.
alwaysUse24HourFormat
);
expect
(
copied
.
accessibleNavigation
,
data
.
accessibleNavigation
);
expect
(
copied
.
accessibleNavigation
,
data
.
accessibleNavigation
);
expect
(
copied
.
invertColors
,
data
.
invertColors
);
expect
(
copied
.
invertColors
,
data
.
invertColors
);
...
@@ -104,7 +102,6 @@ void main() {
...
@@ -104,7 +102,6 @@ void main() {
const
EdgeInsets
customViewPadding
=
EdgeInsets
.
all
(
11.24031
);
const
EdgeInsets
customViewPadding
=
EdgeInsets
.
all
(
11.24031
);
const
EdgeInsets
customViewInsets
=
EdgeInsets
.
all
(
1.67262
);
const
EdgeInsets
customViewInsets
=
EdgeInsets
.
all
(
1.67262
);
const
EdgeInsets
customSystemGestureInsets
=
EdgeInsets
.
all
(
1.5556
);
const
EdgeInsets
customSystemGestureInsets
=
EdgeInsets
.
all
(
1.5556
);
const
double
customPhysicalDepth
=
120.0
;
final
MediaQueryData
data
=
MediaQueryData
.
fromWindow
(
WidgetsBinding
.
instance
.
window
);
final
MediaQueryData
data
=
MediaQueryData
.
fromWindow
(
WidgetsBinding
.
instance
.
window
);
final
MediaQueryData
copied
=
data
.
copyWith
(
final
MediaQueryData
copied
=
data
.
copyWith
(
...
@@ -115,7 +112,6 @@ void main() {
...
@@ -115,7 +112,6 @@ void main() {
viewPadding:
customViewPadding
,
viewPadding:
customViewPadding
,
viewInsets:
customViewInsets
,
viewInsets:
customViewInsets
,
systemGestureInsets:
customSystemGestureInsets
,
systemGestureInsets:
customSystemGestureInsets
,
physicalDepth:
customPhysicalDepth
,
alwaysUse24HourFormat:
true
,
alwaysUse24HourFormat:
true
,
accessibleNavigation:
true
,
accessibleNavigation:
true
,
invertColors:
true
,
invertColors:
true
,
...
@@ -131,7 +127,6 @@ void main() {
...
@@ -131,7 +127,6 @@ void main() {
expect
(
copied
.
viewPadding
,
customViewPadding
);
expect
(
copied
.
viewPadding
,
customViewPadding
);
expect
(
copied
.
viewInsets
,
customViewInsets
);
expect
(
copied
.
viewInsets
,
customViewInsets
);
expect
(
copied
.
systemGestureInsets
,
customSystemGestureInsets
);
expect
(
copied
.
systemGestureInsets
,
customSystemGestureInsets
);
expect
(
copied
.
physicalDepth
,
customPhysicalDepth
);
expect
(
copied
.
alwaysUse24HourFormat
,
true
);
expect
(
copied
.
alwaysUse24HourFormat
,
true
);
expect
(
copied
.
accessibleNavigation
,
true
);
expect
(
copied
.
accessibleNavigation
,
true
);
expect
(
copied
.
invertColors
,
true
);
expect
(
copied
.
invertColors
,
true
);
...
@@ -655,17 +650,6 @@ void main() {
...
@@ -655,17 +650,6 @@ void main() {
fail
(
'The assert was never called when it should have been'
);
fail
(
'The assert was never called when it should have been'
);
});
});
test
(
'physicalDepth parameter in MediaQueryData cannot be null'
,
()
{
try
{
MediaQueryData
(
physicalDepth:
null
);
}
on
AssertionError
catch
(
error
)
{
expect
(
error
.
toString
(),
contains
(
'physicalDepth != null'
));
expect
(
error
.
toString
(),
contains
(
'is not true'
));
return
;
}
fail
(
'The assert was never called when it should have been'
);
});
test
(
'alwaysUse24HourFormat parameter in MediaQueryData cannot be null'
,
()
{
test
(
'alwaysUse24HourFormat parameter in MediaQueryData cannot be null'
,
()
{
try
{
try
{
MediaQueryData
(
alwaysUse24HourFormat:
null
);
MediaQueryData
(
alwaysUse24HourFormat:
null
);
...
...
packages/flutter_test/lib/src/window.dart
View file @
db48cadd
...
@@ -86,22 +86,6 @@ class TestWindow implements Window {
...
@@ -86,22 +86,6 @@ class TestWindow implements Window {
onMetricsChanged
();
onMetricsChanged
();
}
}
@override
double
get
physicalDepth
=>
_physicalDepthTestValue
??
_window
.
physicalDepth
;
double
_physicalDepthTestValue
;
/// Hides the real physical depth and reports the given
/// [physicalDepthTestValue] instead.
set
physicalDepthTestValue
(
double
physicalDepthTestValue
)
{
_physicalDepthTestValue
=
physicalDepthTestValue
;
onMetricsChanged
();
}
/// Deletes any existing test physical depth and returns to using the real
/// physical depth.
void
clearPhysicalDepthTestValue
()
{
_physicalDepthTestValue
=
null
;
onMetricsChanged
();
}
@override
@override
WindowPadding
get
viewInsets
=>
_viewInsetsTestValue
??
_window
.
viewInsets
;
WindowPadding
get
viewInsets
=>
_viewInsetsTestValue
??
_window
.
viewInsets
;
WindowPadding
_viewInsetsTestValue
;
WindowPadding
_viewInsetsTestValue
;
...
@@ -418,7 +402,6 @@ class TestWindow implements Window {
...
@@ -418,7 +402,6 @@ class TestWindow implements Window {
clearLocalesTestValue
();
clearLocalesTestValue
();
clearPaddingTestValue
();
clearPaddingTestValue
();
clearPhysicalSizeTestValue
();
clearPhysicalSizeTestValue
();
clearPhysicalDepthTestValue
();
clearSemanticsEnabledTestValue
();
clearSemanticsEnabledTestValue
();
clearTextScaleFactorTestValue
();
clearTextScaleFactorTestValue
();
clearViewInsetsTestValue
();
clearViewInsetsTestValue
();
...
...
packages/flutter_test/test/window_test.dart
View file @
db48cadd
...
@@ -43,20 +43,6 @@ void main() {
...
@@ -43,20 +43,6 @@ void main() {
);
);
});
});
testWidgets
(
'TestWindow can fake physical depth'
,
(
WidgetTester
tester
)
async
{
verifyThatTestWindowCanFakeProperty
<
double
>(
tester:
tester
,
realValue:
ui
.
window
.
physicalDepth
,
fakeValue:
120.0
,
propertyRetriever:
()
{
return
WidgetsBinding
.
instance
.
window
.
physicalDepth
;
},
propertyFaker:
(
TestWidgetsFlutterBinding
binding
,
double
fakeValue
)
{
binding
.
window
.
physicalDepthTestValue
=
fakeValue
;
},
);
});
testWidgets
(
'TestWindow can fake view insets'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'TestWindow can fake view insets'
,
(
WidgetTester
tester
)
async
{
verifyThatTestWindowCanFakeProperty
<
WindowPadding
>(
verifyThatTestWindowCanFakeProperty
<
WindowPadding
>(
tester:
tester
,
tester:
tester
,
...
...
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