From cfc7573d97ac16cdbc37df283e92f00e22269abc Mon Sep 17 00:00:00 2001 From: Edouard Marquez Date: Sun, 16 Jul 2023 01:32:08 +0200 Subject: [PATCH] A haptic feedback for the close button in a card --- .../lib/cards/product_cards/smooth_product_base_card.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/smooth_app/lib/cards/product_cards/smooth_product_base_card.dart b/packages/smooth_app/lib/cards/product_cards/smooth_product_base_card.dart index 8f77f3acc9a..d37b1e1d3de 100644 --- a/packages/smooth_app/lib/cards/product_cards/smooth_product_base_card.dart +++ b/packages/smooth_app/lib/cards/product_cards/smooth_product_base_card.dart @@ -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, @@ -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(