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
5d37de26
Commit
5d37de26
authored
Jan 15, 2020
by
MH Johnson
Committed by
Flutter GitHub Bot
Jan 15, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Gallery] Fix text contrast ratio on homepage and contacts demo (#48752)
parent
72561cd4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
6 deletions
+39
-6
contacts_demo.dart
examples/flutter_gallery/lib/demo/contacts_demo.dart
+3
-3
options.dart
examples/flutter_gallery/lib/gallery/options.dart
+4
-3
accessibility_test.dart
examples/flutter_gallery/test/accessibility_test.dart
+32
-0
No files found.
examples/flutter_gallery/lib/demo/contacts_demo.dart
View file @
5d37de26
...
...
@@ -169,9 +169,9 @@ class ContactsDemoState extends State<ContactsDemo> {
const
DecoratedBox
(
decoration:
BoxDecoration
(
gradient:
LinearGradient
(
begin:
Alignment
(
0.0
,
-
1.0
)
,
end:
Alignment
(
0
.0
,
-
0.4
),
colors:
<
Color
>[
Color
(
0x
6
0000000
),
Color
(
0x00000000
)],
begin:
Alignment
.
topCenter
,
end:
Alignment
(
0
,
.
35
),
colors:
<
Color
>[
Color
(
0x
C
0000000
),
Color
(
0x00000000
)],
),
),
),
...
...
examples/flutter_gallery/lib/gallery/options.dart
View file @
5d37de26
...
...
@@ -194,9 +194,10 @@ class _Heading extends StatelessWidget {
final
ThemeData
theme
=
Theme
.
of
(
context
);
return
_OptionsItem
(
child:
DefaultTextStyle
(
style:
theme
.
textTheme
.
body1
.
copyWith
(
style:
theme
.
textTheme
.
title
.
copyWith
(
fontFamily:
'GoogleSans'
,
color:
theme
.
accentColor
,
color:
theme
.
colorScheme
.
onPrimary
,
fontWeight:
FontWeight
.
w700
,
),
child:
Semantics
(
child:
Text
(
text
),
...
...
@@ -525,7 +526,7 @@ class GalleryOptionsPage extends StatelessWidget {
_TextDirectionItem
(
options
,
onOptionsChanged
),
_TimeDilationItem
(
options
,
onOptionsChanged
),
const
Divider
(),
const
_Heading
(
'Platform mechanics'
),
const
ExcludeSemantics
(
child:
_Heading
(
'Platform mechanics'
)
),
_PlatformItem
(
options
,
onOptionsChanged
),
...
_enabledDiagnosticItems
(),
const
Divider
(),
...
...
examples/flutter_gallery/test/accessibility_test.dart
View file @
5d37de26
...
...
@@ -3,6 +3,7 @@
// found in the LICENSE file.
import
'package:flutter/material.dart'
;
import
'package:flutter_gallery/gallery/app.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'package:flutter_gallery/demo/all.dart'
;
import
'package:flutter_gallery/gallery/themes.dart'
;
...
...
@@ -756,4 +757,35 @@ void main() {
});
}
});
group
(
'Gallery home page meets text contrast guidelines'
,
()
{
testWidgets
(
'options menu'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
const
GalleryApp
(
testMode:
true
));
await
tester
.
tap
(
find
.
byTooltip
(
'Toggle options page'
));
await
tester
.
pumpAndSettle
();
await
expectLater
(
tester
,
meetsGuideline
(
textContrastGuideline
));
});
testWidgets
(
'options menu - dark theme'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
const
GalleryApp
(
testMode:
true
));
await
tester
.
tap
(
find
.
byTooltip
(
'Toggle options page'
));
await
tester
.
pumpAndSettle
();
// Toggle dark mode.
final
Finder
themeToggleContainer
=
find
.
ancestor
(
of:
find
.
text
(
'Theme'
),
matching:
find
.
byType
(
Container
),
);
final
Finder
themeMenuButton
=
find
.
descendant
(
of:
themeToggleContainer
,
matching:
find
.
byIcon
(
Icons
.
arrow_drop_down
),
);
await
tester
.
tap
(
themeMenuButton
);
await
tester
.
pumpAndSettle
();
await
tester
.
tap
(
find
.
text
(
'Dark'
));
await
tester
.
pumpAndSettle
();
await
expectLater
(
tester
,
meetsGuideline
(
textContrastGuideline
));
});
});
}
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