simple joystick
simple joystick plugin for Flutter. Supports iOS, Android. (Other environments unconfirmed)
App Demo
Getting Started
In your flutter project add the dependency:
dependencies:
...
simple_joystick:
Usage example
import 'package:simple_joystick/simple_joystick.dart';
Usage
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
JoyStick(
150, // JoyStickAreaSize
50, // JoyStickStickSize
(details) {
// Please describe what you want to do after the stick move.
},
),
],
),
CallBack Detail
typedef StickDragCallback = void Function(StickDragDetails details);
class StickDragDetails {
StickDragDetails(
this.x, // Global X coordinate after moving
this.y, // Global Y coordinate after moving
this.alignment,
this.currentOffset,
);
final double x;
final double y;
final Alignment alignment;
final Offset currentOffset;
}