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
7ff3a50f
Unverified
Commit
7ff3a50f
authored
Feb 26, 2020
by
Miguel Beltran
Committed by
GitHub
Feb 26, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set highContrast value from AccessibilityFeatures into MediaQueryData (#48811)
parent
9da15d8f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
1 deletion
+21
-1
media_query.dart
packages/flutter/lib/src/widgets/media_query.dart
+1
-1
media_query_test.dart
packages/flutter/test/widgets/media_query_test.dart
+16
-0
window_test.dart
packages/flutter_test/test/window_test.dart
+4
-0
No files found.
packages/flutter/lib/src/widgets/media_query.dart
View file @
7ff3a50f
...
...
@@ -124,7 +124,7 @@ class MediaQueryData {
invertColors
=
window
.
accessibilityFeatures
.
invertColors
,
disableAnimations
=
window
.
accessibilityFeatures
.
disableAnimations
,
boldText
=
window
.
accessibilityFeatures
.
boldText
,
highContrast
=
false
,
highContrast
=
window
.
accessibilityFeatures
.
highContrast
,
alwaysUse24HourFormat
=
window
.
alwaysUse24HourFormat
;
/// The size of the media in logical pixels (e.g, the size of the screen).
...
...
packages/flutter/test/widgets/media_query_test.dart
View file @
7ff3a50f
...
...
@@ -67,6 +67,7 @@ void main() {
expect
(
data
.
invertColors
,
false
);
expect
(
data
.
disableAnimations
,
false
);
expect
(
data
.
boldText
,
false
);
expect
(
data
.
highContrast
,
false
);
expect
(
data
.
platformBrightness
,
Brightness
.
light
);
expect
(
data
.
physicalDepth
,
equals
(
WidgetsBinding
.
instance
.
window
.
physicalDepth
));
});
...
...
@@ -87,6 +88,7 @@ void main() {
expect
(
copied
.
invertColors
,
data
.
invertColors
);
expect
(
copied
.
disableAnimations
,
data
.
disableAnimations
);
expect
(
copied
.
boldText
,
data
.
boldText
);
expect
(
copied
.
highContrast
,
data
.
highContrast
);
expect
(
copied
.
platformBrightness
,
data
.
platformBrightness
);
});
...
...
@@ -117,6 +119,7 @@ void main() {
invertColors:
true
,
disableAnimations:
true
,
boldText:
true
,
highContrast:
true
,
platformBrightness:
Brightness
.
dark
,
);
expect
(
copied
.
size
,
customSize
);
...
...
@@ -132,6 +135,7 @@ void main() {
expect
(
copied
.
invertColors
,
true
);
expect
(
copied
.
disableAnimations
,
true
);
expect
(
copied
.
boldText
,
true
);
expect
(
copied
.
highContrast
,
true
);
expect
(
copied
.
platformBrightness
,
Brightness
.
dark
);
});
...
...
@@ -158,6 +162,7 @@ void main() {
invertColors:
true
,
disableAnimations:
true
,
boldText:
true
,
highContrast:
true
,
),
child:
Builder
(
builder:
(
BuildContext
context
)
{
...
...
@@ -190,6 +195,7 @@ void main() {
expect
(
unpadded
.
invertColors
,
true
);
expect
(
unpadded
.
disableAnimations
,
true
);
expect
(
unpadded
.
boldText
,
true
);
expect
(
unpadded
.
highContrast
,
true
);
});
testWidgets
(
'MediaQuery.removePadding only removes specified padding'
,
(
WidgetTester
tester
)
async
{
...
...
@@ -215,6 +221,7 @@ void main() {
invertColors:
true
,
disableAnimations:
true
,
boldText:
true
,
highContrast:
true
,
),
child:
Builder
(
builder:
(
BuildContext
context
)
{
...
...
@@ -244,6 +251,7 @@ void main() {
expect
(
unpadded
.
invertColors
,
true
);
expect
(
unpadded
.
disableAnimations
,
true
);
expect
(
unpadded
.
boldText
,
true
);
expect
(
unpadded
.
highContrast
,
true
);
});
testWidgets
(
'MediaQuery.removeViewInsets removes specified viewInsets'
,
(
WidgetTester
tester
)
async
{
...
...
@@ -269,6 +277,7 @@ void main() {
invertColors:
true
,
disableAnimations:
true
,
boldText:
true
,
highContrast:
true
,
),
child:
Builder
(
builder:
(
BuildContext
context
)
{
...
...
@@ -301,6 +310,7 @@ void main() {
expect
(
unpadded
.
invertColors
,
true
);
expect
(
unpadded
.
disableAnimations
,
true
);
expect
(
unpadded
.
boldText
,
true
);
expect
(
unpadded
.
highContrast
,
true
);
});
testWidgets
(
'MediaQuery.removeViewInsets removes only specified viewInsets'
,
(
WidgetTester
tester
)
async
{
...
...
@@ -326,6 +336,7 @@ void main() {
invertColors:
true
,
disableAnimations:
true
,
boldText:
true
,
highContrast:
true
,
),
child:
Builder
(
builder:
(
BuildContext
context
)
{
...
...
@@ -355,6 +366,7 @@ void main() {
expect
(
unpadded
.
invertColors
,
true
);
expect
(
unpadded
.
disableAnimations
,
true
);
expect
(
unpadded
.
boldText
,
true
);
expect
(
unpadded
.
highContrast
,
true
);
});
testWidgets
(
'MediaQuery.removeViewPadding removes specified viewPadding'
,
(
WidgetTester
tester
)
async
{
...
...
@@ -380,6 +392,7 @@ void main() {
invertColors:
true
,
disableAnimations:
true
,
boldText:
true
,
highContrast:
true
,
),
child:
Builder
(
builder:
(
BuildContext
context
)
{
...
...
@@ -412,6 +425,7 @@ void main() {
expect
(
unpadded
.
invertColors
,
true
);
expect
(
unpadded
.
disableAnimations
,
true
);
expect
(
unpadded
.
boldText
,
true
);
expect
(
unpadded
.
highContrast
,
true
);
});
testWidgets
(
'MediaQuery.removeViewPadding removes only specified viewPadding'
,
(
WidgetTester
tester
)
async
{
...
...
@@ -437,6 +451,7 @@ void main() {
invertColors:
true
,
disableAnimations:
true
,
boldText:
true
,
highContrast:
true
,
),
child:
Builder
(
builder:
(
BuildContext
context
)
{
...
...
@@ -466,6 +481,7 @@ void main() {
expect
(
unpadded
.
invertColors
,
true
);
expect
(
unpadded
.
disableAnimations
,
true
);
expect
(
unpadded
.
boldText
,
true
);
expect
(
unpadded
.
highContrast
,
true
);
});
testWidgets
(
'MediaQuery.textScaleFactorOf'
,
(
WidgetTester
tester
)
async
{
...
...
packages/flutter_test/test/window_test.dart
View file @
7ff3a50f
...
...
@@ -256,6 +256,7 @@ class FakeAccessibilityFeatures implements AccessibilityFeatures {
this
.
disableAnimations
=
false
,
this
.
boldText
=
false
,
this
.
reduceMotion
=
false
,
this
.
highContrast
=
false
,
});
@override
...
...
@@ -273,6 +274,9 @@ class FakeAccessibilityFeatures implements AccessibilityFeatures {
@override
final
bool
reduceMotion
;
@override
final
bool
highContrast
;
/// This gives us some grace time when the dart:ui side adds something to
/// [AccessibilityFeatures], and makes things easier when we do rolls to
/// give us time to catch up.
...
...
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