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
35a7f437
Unverified
Commit
35a7f437
authored
Mar 29, 2018
by
Michael Goderbauer
Committed by
GitHub
Mar 29, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix FAB Tooltip semantics label (#16072)
parent
69f0c839
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
7 deletions
+45
-7
floating_action_button.dart
...ages/flutter/lib/src/material/floating_action_button.dart
+11
-7
floating_action_button_test.dart
...es/flutter/test/material/floating_action_button_test.dart
+34
-0
No files found.
packages/flutter/lib/src/material/floating_action_button.dart
View file @
35a7f437
...
...
@@ -253,6 +253,17 @@ class _FloatingActionButtonState extends State<FloatingActionButton> {
);
}
if
(
widget
.
tooltip
!=
null
)
{
// The long-pressable area for the tooltip should always be as big as
// the tooltip even if there is no child.
result
=
new
SizedBox
.
expand
(
child:
new
Tooltip
(
message:
widget
.
tooltip
,
child:
result
,
),
);
}
result
=
new
RawMaterialButton
(
onPressed:
widget
.
onPressed
,
onHighlightChanged:
_handleHighlightChanged
,
...
...
@@ -267,13 +278,6 @@ class _FloatingActionButtonState extends State<FloatingActionButton> {
child:
result
,
);
if
(
widget
.
tooltip
!=
null
)
{
result
=
new
Tooltip
(
message:
widget
.
tooltip
,
child:
result
,
);
}
if
(
widget
.
heroTag
!=
null
)
{
result
=
new
Hero
(
tag:
widget
.
heroTag
,
...
...
packages/flutter/test/material/floating_action_button_test.dart
View file @
35a7f437
...
...
@@ -253,6 +253,40 @@ void main() {
semantics
.
dispose
();
});
testWidgets
(
'Tooltip is used as semantics label'
,
(
WidgetTester
tester
)
async
{
final
SemanticsTester
semantics
=
new
SemanticsTester
(
tester
);
await
tester
.
pumpWidget
(
new
MaterialApp
(
home:
new
Scaffold
(
floatingActionButton:
new
FloatingActionButton
(
onPressed:
()
{
},
tooltip:
'Add Photo'
,
child:
const
Icon
(
Icons
.
add_a_photo
),
),
),
),
);
expect
(
semantics
,
hasSemantics
(
new
TestSemantics
.
root
(
children:
<
TestSemantics
>[
new
TestSemantics
.
rootChild
(
label:
'Add Photo'
,
actions:
<
SemanticsAction
>[
SemanticsAction
.
tap
],
flags:
<
SemanticsFlag
>[
SemanticsFlag
.
isButton
,
SemanticsFlag
.
hasEnabledState
,
SemanticsFlag
.
isEnabled
,
],
),
],
),
ignoreTransform:
true
,
ignoreId:
true
,
ignoreRect:
true
));
semantics
.
dispose
();
});
group
(
'ComputeNotch'
,
()
{
testWidgets
(
'host and guest must intersect'
,
(
WidgetTester
tester
)
async
{
final
ComputeNotch
computeNotch
=
await
fetchComputeNotch
(
tester
,
const
FloatingActionButton
(
onPressed:
null
));
...
...
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