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

@ -3,13 +3,13 @@ import 'dart:ui';
import 'package:flame/components.dart';
import 'package:flame/effects.dart';
import 'package:flame/events.dart';
import 'package:flame/game.dart';
import 'package:flame/geometry.dart';
import 'package:flame/input.dart';
import 'package:flame/palette.dart';
import 'package:flutter/animation.dart';
class ScaleEffectExample extends FlameGame with TapDetector {
class ScaleEffectExample extends FlameGame with TapCallbacks {
static const String description = '''
In this example you can tap the screen and the component will scale up or
down, depending on its current state.
@ -56,7 +56,7 @@ class ScaleEffectExample extends FlameGame with TapDetector {
}
@override
void onTap() {
void onTapDown(_) {
final s = grow ? 3.0 : 1.0;
grow = !grow;