Haptisches Feedback hinzufügen #216
@@ -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();
|
||||||
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ class GameTile extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLongPress: () async {
|
onLongPress: () async {
|
||||||
await HapticFeedback.vibrate();
|
await HapticFeedback.heavyImpact();
|
||||||
if (onLongPress != null) {
|
if (onLongPress != null) {
|
||||||
onLongPress!.call();
|
onLongPress!.call();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user