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
049ea73c
Unverified
Commit
049ea73c
authored
Dec 02, 2021
by
chunhtai
Committed by
GitHub
Dec 02, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MinimumTextContrastGuideline should exclude disabled component (#94489)
parent
bccc9eac
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
1 deletion
+27
-1
accessibility.dart
packages/flutter_test/lib/src/accessibility.dart
+4
-1
accessibility_test.dart
packages/flutter_test/test/accessibility_test.dart
+23
-0
No files found.
packages/flutter_test/lib/src/accessibility.dart
View file @
049ea73c
...
...
@@ -212,7 +212,10 @@ class MinimumTextContrastGuideline extends AccessibilityGuideline {
Future
<
Evaluation
>
evaluateNode
(
SemanticsNode
node
)
async
{
Evaluation
result
=
const
Evaluation
.
pass
();
if
(
node
.
isInvisible
||
node
.
isMergedIntoParent
||
node
.
hasFlag
(
ui
.
SemanticsFlag
.
isHidden
))
if
(
node
.
isInvisible
||
node
.
isMergedIntoParent
||
node
.
hasFlag
(
ui
.
SemanticsFlag
.
isHidden
)
||
(
node
.
hasFlag
(
ui
.
SemanticsFlag
.
hasEnabledState
)
&&
!
node
.
hasFlag
(
ui
.
SemanticsFlag
.
isEnabled
)))
return
result
;
final
SemanticsData
data
=
node
.
getSemanticsData
();
final
List
<
SemanticsNode
>
children
=
<
SemanticsNode
>[];
...
...
packages/flutter_test/test/accessibility_test.dart
View file @
049ea73c
...
...
@@ -177,6 +177,29 @@ void main() {
expect
(
result
.
passed
,
true
);
handle
.
dispose
();
});
testWidgets
(
'Disabled button is excluded from text contrast guideline'
,
(
WidgetTester
tester
)
async
{
// Regression test https://github.com/flutter/flutter/issues/94428
final
SemanticsHandle
handle
=
tester
.
ensureSemantics
();
await
tester
.
pumpWidget
(
_boilerplate
(
ElevatedButton
(
onPressed:
null
,
child:
Container
(
width:
200.0
,
height:
200.0
,
color:
Colors
.
yellow
,
child:
const
Text
(
'this is a test'
,
style:
TextStyle
(
fontSize:
14.0
,
color:
Colors
.
yellowAccent
),
),
),
),
)
);
await
expectLater
(
tester
,
meetsGuideline
(
textContrastGuideline
));
handle
.
dispose
();
});
});
group
(
'custom minimum contrast guideline'
,
()
{
...
...
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