Flutter Joystick

Pub License Pub likes Pub popularity Pub points Flutter platform

Buy Me A Coffee PayPal

A virtual joystick for Flutter applications.



Joystick(listener: (details) {

Joystick arguments:

listenercallback, which is called with period frequency when the stick is dragged. Listener parameter details contains the stick offset from the center of the base (can be from -1.0 to +1.0).
periodfrequency of calling listener from the moment the stick is dragged, by default 100 milliseconds.
modepossible directions mode of the joystick stick, by default all

Possible joystick modes:

allallow move the stick in any direction: vertical, horizontal and diagonal
verticalallow move the stick only in vertical direction
horizontalallow move the stick only in horizontal direction
horizontalAndVerticalallow move the stick only in horizontal and vertical directions, not diagonal

Joystick Vertical Joystick Horizontal Joystick Horizontal And Vertical

Joystick Area


JoystickArea allows to render a joystick anywhere in this area where user clicks.

  listener: (details) {
  child: ...

JoystickArea has the same arguments as Joystick (listener, period, mode, etc.).

Additional JoystickArea arguments:

initialJoystickAlignmentInitial joystick alignment relative to the joystick area, by default Alignment.bottomCenter.
childThe child contained by the joystick area.


Square Joystick

Joystick and JoystickArea have additional arguments that allow to customize their appearance and behaviour.

baseWidget that renders joystick base, by default JoystickBase.
stickWidget that renders joystick stick, it places in the center of base widget, by default JoystickStick.
stickOffsetCalculatorCalculate offset of the stick based on the stick drag start position and the current stick position. The package currently only supports circle and rectangle joystick shapes. By default CircleStickOffsetCalculator.


If you found this package helpful and would like to thank me:

Buy Me A Coffee PayPal