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
f0c4bc30
Unverified
Commit
f0c4bc30
authored
Apr 28, 2018
by
Jonah Williams
Committed by
GitHub
Apr 28, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add SemanticService.tooltip method for Android tooltips (#16978)
parent
6334da01
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
1 deletion
+29
-1
tooltip.dart
packages/flutter/lib/src/material/tooltip.dart
+1
-0
semantics_event.dart
packages/flutter/lib/src/semantics/semantics_event.dart
+19
-0
semantics_service.dart
packages/flutter/lib/src/semantics/semantics_service.dart
+9
-1
No files found.
packages/flutter/lib/src/material/tooltip.dart
View file @
f0c4bc30
...
...
@@ -147,6 +147,7 @@ class _TooltipState extends State<Tooltip> with SingleTickerProviderStateMixin {
_entry
=
new
OverlayEntry
(
builder:
(
BuildContext
context
)
=>
overlay
);
Overlay
.
of
(
context
,
debugRequiredFor:
widget
).
insert
(
_entry
);
GestureBinding
.
instance
.
pointerRouter
.
addGlobalRoute
(
_handlePointerEvent
);
SemanticsService
.
tooltip
(
widget
.
message
);
_controller
.
forward
();
return
true
;
}
...
...
packages/flutter/lib/src/semantics/semantics_event.dart
View file @
f0c4bc30
...
...
@@ -88,3 +88,22 @@ class AnnounceSemanticsEvent extends SemanticsEvent {
};
}
}
/// An event for a semantic announcement of a tooltip.
///
/// This is only used by Android to announce tooltip values.
class
TooltipSemanticsEvent
extends
SemanticsEvent
{
/// Constructs an event that triggers a tooltip announcement by the platform.
const
TooltipSemanticsEvent
(
this
.
message
)
:
super
(
'tooltip'
);
/// The text content of the tooltip.
final
String
message
;
@override
Map
<
String
,
dynamic
>
getDataMap
()
{
return
<
String
,
dynamic
>{
'message'
:
message
,
};
}
}
packages/flutter/lib/src/semantics/semantics_service.dart
View file @
f0c4bc30
...
...
@@ -7,7 +7,7 @@ import 'dart:ui' show TextDirection;
import
'package:flutter/services.dart'
show
SystemChannels
;
import
'semantics_event.dart'
show
AnnounceSemanticsEvent
;
import
'semantics_event.dart'
show
AnnounceSemanticsEvent
,
TooltipSemanticsEvent
;
/// Allows access to the platform's accessibility services.
...
...
@@ -31,4 +31,12 @@ class SemanticsService {
final
AnnounceSemanticsEvent
event
=
new
AnnounceSemanticsEvent
(
message
,
textDirection
);
await
SystemChannels
.
accessibility
.
send
(
event
.
toMap
());
}
/// Sends a semantic announcement of a tooltip.
///
/// This is only used by Android.
static
Future
<
Null
>
tooltip
(
String
message
)
async
{
final
TooltipSemanticsEvent
event
=
new
TooltipSemanticsEvent
(
message
);
await
SystemChannels
.
accessibility
.
send
(
event
.
toMap
());
}
}
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