mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-03 04:18:25 +08:00
feat: Added toString method to all the drags events message handlers (#2014)
Added toString method to all Drag Event message Handlers in flame/lib/src/events/messages/ which were returning pure data objects and were not much meaningful
This commit is contained in:
@ -11,4 +11,7 @@ class DragCancelEvent extends Event {
|
||||
final int pointerId;
|
||||
|
||||
DragEndEvent toDragEnd() => DragEndEvent(pointerId, DragEndDetails());
|
||||
|
||||
@override
|
||||
String toString() => 'DragCancelEvent(pointerId: $pointerId)';
|
||||
}
|
||||
|
||||
@ -20,4 +20,8 @@ class DragEndEvent extends Event {
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() =>
|
||||
'DragEndEvent(pointerId: $pointerId, velocity: $velocity)';
|
||||
}
|
||||
|
||||
@ -34,4 +34,9 @@ class DragStartEvent extends PositionEvent {
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() => 'DragStartEvent(canvasPosition: $canvasPosition, '
|
||||
'devicePosition: $devicePosition, '
|
||||
'pointedId: $pointerId, deviceKind: $deviceKind)';
|
||||
}
|
||||
|
||||
@ -36,4 +36,10 @@ class DragUpdateEvent extends PositionEvent {
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() => 'DragUpdateEvent(devicePosition: $devicePosition, '
|
||||
'canvasPosition: $canvasPosition, '
|
||||
'delta: $delta, '
|
||||
'pointerId: $pointerId, timestamp: $timestamp)';
|
||||
}
|
||||
|
||||
@ -19,4 +19,7 @@ class TapCancelEvent extends Event {
|
||||
/// The id of the event that has been cancelled. This id corresponds to the
|
||||
/// id of the previous [TapDownEvent].
|
||||
final int pointerId;
|
||||
|
||||
@override
|
||||
String toString() => 'TapCancelEvent(pointerId: $pointerId)';
|
||||
}
|
||||
|
||||
@ -44,4 +44,9 @@ class TapDownEvent extends PositionEvent {
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() => 'TapDownEvent(canvasPosition: $canvasPosition, '
|
||||
'devicePosition: $devicePosition, '
|
||||
'pointerId: $pointerId, deviceKind: $deviceKind)';
|
||||
}
|
||||
|
||||
@ -36,4 +36,9 @@ class TapUpEvent extends PositionEvent {
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() => 'TapUpEvent(canvasPosition: $canvasPosition, '
|
||||
'devicePosition: $devicePosition, '
|
||||
'pointerId: $pointerId, deviceKind: $deviceKind)';
|
||||
}
|
||||
|
||||
@ -4,7 +4,6 @@ import 'package:flutter/material.dart';
|
||||
|
||||
class Player extends PositionComponent {
|
||||
static final _paint = Paint()..color = Colors.white;
|
||||
|
||||
@override
|
||||
void render(Canvas canvas) {
|
||||
canvas.drawRect(size.toRect(), _paint);
|
||||
|
||||
Reference in New Issue
Block a user