Skip to content

Commit

Permalink
Merge pull request #89 from Gones/master
Browse files Browse the repository at this point in the history
add ripple effect when tapping on the IconSlideAction widget
  • Loading branch information
letsar authored Oct 6, 2019
2 parents 9b06963 + f3cfa12 commit ca0376c
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions lib/src/widgets/slide_action.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ abstract class ClosableSlideAction extends StatelessWidget {
/// The [closeOnTap] argument must not be null.
const ClosableSlideAction({
Key key,
this.color,
this.onTap,
this.closeOnTap = _kCloseOnTap,
}) : assert(closeOnTap != null),
super(key: key);

final Color color;
/// A tap has occurred.
final VoidCallback onTap;

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

Widget build(BuildContext context) {
return GestureDetector(
onTap: !closeOnTap ? onTap : () => _handleCloseAfterTap(context),
child: buildAction(context),
child: Material(
color: color,
child: InkWell(
onTap: !closeOnTap ? onTap : () => _handleCloseAfterTap(context),
child: buildAction(context),
),
),
);
}

Expand Down Expand Up @@ -116,6 +123,7 @@ class IconSlideAction extends ClosableSlideAction {
'Either set icon or iconWidget.'),
super(
key: key,
color: color,
onTap: onTap,
closeOnTap: closeOnTap,
);
Expand Down Expand Up @@ -181,7 +189,6 @@ class IconSlideAction extends ClosableSlideAction {
}

return Container(
color: color,
child: Center(
child: Column(
mainAxisSize: MainAxisSize.min,
Expand Down

0 comments on commit ca0376c

Please sign in to comment.