Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Remove references to Tappable and Draggable #2912

Merged
merged 3 commits into from
Dec 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .markdownlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@ MD044:
html_elements: true

# MD045/no-alt-text - Images should have alternate text (alt text)
MD045: true
# TODO: Activate this with #2913
MD045: false

# MD046/code-block-style - Code block style
MD046:
Expand Down
8 changes: 4 additions & 4 deletions doc/flame/components.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,12 @@ In the following example we first initialize the component with priority 1, and
user taps the component we change its priority to 2:

```dart
class MyComponent extends PositionComponent with Tappable {
class MyComponent extends PositionComponent with TapCallbacks {

MyComponent() : super(priority: 1);

@override
void onTap() {
void onTapDown(TapDownEvent event) {
priority = 2;
}
}
Expand Down Expand Up @@ -818,8 +818,8 @@ robot.animationTickers?[RobotState.idle]?.onFrame = (currentIndex) {
Example:

```dart
class ButtonComponent extends SpriteGroupComponent<ButtonState>
with HasGameRef<SpriteGroupExample>, Tappable {
class PlayerComponent extends SpriteGroupComponent<ButtonState>
with HasGameReference<SpriteGroupExample>, TapCallbacks {
@override
Future<void>? onLoad() async {
final pressedSprite = await gameRef.loadSprite(/* omitted */);
Expand Down
2 changes: 1 addition & 1 deletion doc/flame/examples/lib/collision_detection.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'package:flame/collisions.dart';
import 'package:flame/components.dart';
import 'package:flame/effects.dart';
import 'package:flame/game.dart';
import 'package:flutter/material.dart' hide Image, Draggable;
import 'package:flutter/material.dart' hide Image;

class CollisionDetectionGame extends FlameGame with HasCollisionDetection {
@override
Expand Down
2 changes: 1 addition & 1 deletion doc/flame/inputs/keyboard_input.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class MyGame extends FlameGame with KeyboardEvents {

To receive keyboard events directly in components, there is the mixin `KeyboardHandler`.

Similarly to `Tappable` and `Draggable`, `KeyboardHandler` can be mixed into any subclass of
Similarly to `TapCallbacks` and `DragCallbacks`, `KeyboardHandler` can be mixed into any subclass of
`Component`.

KeyboardHandlers must only be added to games that are mixed with `HasKeyboardHandlerComponents`.
Expand Down
2 changes: 1 addition & 1 deletion doc/flame/inputs/tap_events.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Every component that received an `onTapDown` event will eventually receive eithe
### onLongTapDown

If the user holds their finger down for some time (as configured by the `.longTapDelay` property
in `HasTappableComponents`), the "long tap" will be generated. This event invokes the
in `MultiTapDispatcher`), "long tap" will be triggered. This event invokes the
`void onLongTapDown(TapDownEvent)` handler on those components that previously received the
`onTapDown` event.

Expand Down
2 changes: 1 addition & 1 deletion examples/lib/stories/input/input.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import 'package:flutter/material.dart';
void addInputStories(Dashbook dashbook) {
dashbook.storiesOf('Input')
..add(
'Tappables',
'TapCallbacks',
(_) => GameWidget(game: TapCallbacksExample()),
codeLink: baseLink('input/tap_callbacks_example.dart'),
info: TapCallbacksExample.description,
Expand Down
4 changes: 2 additions & 2 deletions examples/lib/stories/input/tap_callbacks_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import 'package:flutter/material.dart';

class TapCallbacksExample extends FlameGame {
static const String description = '''
In this example we show the `Tappable` mixin functionality. You can add the
`Tappable` mixin to any `PositionComponent`.\n\n
In this example we show the `TapCallbacks` mixin functionality. You can add
the `TapCallbacks` mixin to any `PositionComponent`.\n\n
Tap the squares to see them change their angle around their anchor.
''';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import 'package:meta/meta.dart';
/// In addition to adding this mixin, the component must also implement the
/// [containsLocalPoint] method -- the component will only be considered
/// "tapped" if the point where the tap has occurred is inside the component.
///
/// This mixin is the replacement of the Tappable mixin.
mixin TapCallbacks on Component {
void onTapDown(TapDownEvent event) {}
void onLongTapDown(TapDownEvent event) {}
Expand Down
283 changes: 0 additions & 283 deletions packages/flame/test/components/mixins/tappable_test.dart

This file was deleted.

2 changes: 1 addition & 1 deletion packages/flame_rive/test/flame_rive_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ void main() {
});

testWithFlameGame(
'Can Add with Tappable',
'Can Add with TapCallbacks',
(game) async {
final child = _RiveComponentWithTappable(
artboard: await loadArtboard(riveFile),
Expand Down