Skip to content

Commit

Permalink
A haptic feedback for the close button in a card
Browse files Browse the repository at this point in the history
  • Loading branch information
g123k committed Jul 15, 2023
1 parent 00f42ae commit cfc7573
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:smooth_app/generic_lib/design_constants.dart';
import 'package:smooth_app/generic_lib/widgets/smooth_card.dart';
import 'package:smooth_app/helpers/haptic_feedback_helper.dart';

/// A common Widget for carrousel item cards.
/// It allows to have the correct width/height and also a scale down feature,
Expand Down Expand Up @@ -66,7 +67,10 @@ class ProductCardCloseButton extends StatelessWidget {

return InkWell(
customBorder: const CircleBorder(),
onTap: () => onRemove?.call(context),
onTap: () {
onRemove?.call(context);
SmoothHapticFeedback.lightNotification();
},
child: Tooltip(
message: appLocalizations.product_card_remove_product_tooltip,
child: Padding(
Expand Down

0 comments on commit cfc7573

Please sign in to comment.