docs: Deprecate TapDetector in favour of TapCallbacks (#2886)

Deprecate `TapDetector` in favour of `TapCallbacks`
This commit is contained in:
Luan Nico
2025-10-02 13:21:05 -07:00
committed by GitHub
parent 36eb3929aa
commit b173697bfb
35 changed files with 90 additions and 83 deletions

View File

@ -10,7 +10,7 @@ void main() async {
runApp(const GameWidget.controlled(gameFactory: SpineExample.new));
}
class SpineExample extends FlameGame with TapDetector {
class SpineExample extends FlameGame with TapCallbacks {
late final SpineComponent spineboy;
final states = [
@ -46,7 +46,7 @@ class SpineExample extends FlameGame with TapDetector {
}
@override
void onTap() {
void onTapDown(_) {
_stateIndex = (_stateIndex + 1) % states.length;
spineboy.animationState.setAnimationByName(0, states[_stateIndex], true);
}