Skip to content

Commit ca0376c

Browse files
authored
Merge pull request #89 from Gones/master
add ripple effect when tapping on the IconSlideAction widget
2 parents 9b06963 + f3cfa12 commit ca0376c

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

lib/src/widgets/slide_action.dart

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@ abstract class ClosableSlideAction extends StatelessWidget {
1212
/// The [closeOnTap] argument must not be null.
1313
const ClosableSlideAction({
1414
Key key,
15+
this.color,
1516
this.onTap,
1617
this.closeOnTap = _kCloseOnTap,
1718
}) : assert(closeOnTap != null),
1819
super(key: key);
1920

21+
final Color color;
2022
/// A tap has occurred.
2123
final VoidCallback onTap;
2224

@@ -34,8 +36,13 @@ abstract class ClosableSlideAction extends StatelessWidget {
3436

3537
Widget build(BuildContext context) {
3638
return GestureDetector(
37-
onTap: !closeOnTap ? onTap : () => _handleCloseAfterTap(context),
38-
child: buildAction(context),
39+
child: Material(
40+
color: color,
41+
child: InkWell(
42+
onTap: !closeOnTap ? onTap : () => _handleCloseAfterTap(context),
43+
child: buildAction(context),
44+
),
45+
),
3946
);
4047
}
4148

@@ -116,6 +123,7 @@ class IconSlideAction extends ClosableSlideAction {
116123
'Either set icon or iconWidget.'),
117124
super(
118125
key: key,
126+
color: color,
119127
onTap: onTap,
120128
closeOnTap: closeOnTap,
121129
);
@@ -181,7 +189,6 @@ class IconSlideAction extends ClosableSlideAction {
181189
}
182190

183191
return Container(
184-
color: color,
185192
child: Center(
186193
child: Column(
187194
mainAxisSize: MainAxisSize.min,

0 commit comments

Comments
 (0)