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
487e6bc9
Unverified
Commit
487e6bc9
authored
Apr 03, 2018
by
Greg Spencer
Committed by
GitHub
Apr 03, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding onTapDown and onTapCancel to InkWell (#16190)
parent
5e942441
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
1 deletion
+20
-1
ink_well.dart
packages/flutter/lib/src/material/ink_well.dart
+20
-1
No files found.
packages/flutter/lib/src/material/ink_well.dart
View file @
487e6bc9
...
...
@@ -192,6 +192,8 @@ class InkResponse extends StatefulWidget {
Key
key
,
this
.
child
,
this
.
onTap
,
this
.
onTapDown
,
this
.
onTapCancel
,
this
.
onDoubleTap
,
this
.
onLongPress
,
this
.
onHighlightChanged
,
...
...
@@ -218,6 +220,13 @@ class InkResponse extends StatefulWidget {
/// Called when the user taps this part of the material.
final
GestureTapCallback
onTap
;
/// Called when the user taps down this part of the material.
final
GestureTapDownCallback
onTapDown
;
/// Called when the user cancels a tap that was started on this part of the
/// material.
final
GestureTapCallback
onTapCancel
;
/// Called when the user double taps this part of the material.
final
GestureTapCallback
onDoubleTap
;
...
...
@@ -464,6 +473,9 @@ class _InkResponseState<T extends InkResponse> extends State<T> with AutomaticKe
_splashes
??=
new
HashSet
<
InteractiveInkFeature
>();
_splashes
.
add
(
splash
);
_currentSplash
=
splash
;
if
(
widget
.
onTapDown
!=
null
)
{
widget
.
onTapDown
(
details
);
}
updateKeepAlive
();
updateHighlight
(
true
);
}
...
...
@@ -482,6 +494,9 @@ class _InkResponseState<T extends InkResponse> extends State<T> with AutomaticKe
void
_handleTapCancel
()
{
_currentSplash
?.
cancel
();
_currentSplash
=
null
;
if
(
widget
.
onTapCancel
!=
null
)
{
widget
.
onTapCancel
();
}
updateHighlight
(
false
);
}
...
...
@@ -548,7 +563,7 @@ class _InkResponseState<T extends InkResponse> extends State<T> with AutomaticKe
///
/// ![The highlight is a rectangle the size of the box.](https://flutter.github.io/assets-for-api-docs/material/ink_well.png)
///
/// The [Ink
Response
] widget must have a [Material] widget as an ancestor. The
/// The [Ink
Well
] widget must have a [Material] widget as an ancestor. The
/// [Material] widget is where the ink reactions are actually painted. This
/// matches the material design premise wherein the [Material] is what is
/// actually reacting to touches by spreading ink.
...
...
@@ -599,6 +614,8 @@ class InkWell extends InkResponse {
GestureTapCallback
onTap
,
GestureTapCallback
onDoubleTap
,
GestureLongPressCallback
onLongPress
,
GestureTapDownCallback
onTapDown
,
GestureTapCancelCallback
onTapCancel
,
ValueChanged
<
bool
>
onHighlightChanged
,
Color
highlightColor
,
Color
splashColor
,
...
...
@@ -613,6 +630,8 @@ class InkWell extends InkResponse {
onTap:
onTap
,
onDoubleTap:
onDoubleTap
,
onLongPress:
onLongPress
,
onTapDown:
onTapDown
,
onTapCancel:
onTapCancel
,
onHighlightChanged:
onHighlightChanged
,
containedInkWell:
true
,
highlightShape:
BoxShape
.
rectangle
,
...
...
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