Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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