fix: long press feedback on every call
This commit is contained in:
@@ -70,11 +70,14 @@ class _MainMenuButtonState extends State<MainMenuButton>
|
|||||||
const Duration(milliseconds: 400),
|
const Duration(milliseconds: 400),
|
||||||
() async {
|
() async {
|
||||||
_isLongPressing = true;
|
_isLongPressing = true;
|
||||||
await HapticFeedback.vibrate();
|
|
||||||
widget.onLongPressed?.call();
|
widget.onLongPressed?.call();
|
||||||
|
await HapticFeedback.heavyImpact();
|
||||||
_repeatTimer = Timer.periodic(
|
_repeatTimer = Timer.periodic(
|
||||||
const Duration(milliseconds: 250),
|
const Duration(milliseconds: 250),
|
||||||
(_) => widget.onLongPressed?.call(),
|
(_) async {
|
||||||
|
widget.onLongPressed?.call();
|
||||||
|
await HapticFeedback.heavyImpact();
|
||||||
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user