Giter VIP home page Giter VIP logo

flutter_joystick's Introduction

Flutter Joystick

Pub License Pub likes Pub popularity Pub points Flutter platform

Buy Me A Coffee PayPal

A virtual joystick for Flutter applications.

Joystick

Joystick

Joystick(listener: (details) {
...
})

Joystick arguments:

Parameter Description
listener callback, 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).
period frequency of calling listener from the moment the stick is dragged, by default 100 milliseconds.
mode possible directions mode of the joystick stick, by default all

Possible joystick modes:

Mode Description
all allow move the stick in any direction: vertical, horizontal and diagonal
vertical allow move the stick only in vertical direction
horizontal allow move the stick only in horizontal direction
horizontalAndVertical allow move the stick only in horizontal and vertical directions, not diagonal

Joystick Vertical Joystick Horizontal Joystick Horizontal And Vertical

Joystick Area

Joystick

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

JoystickArea(
  listener: (details) {
    ...
  },
  child: ...
)

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

Additional JoystickArea arguments:

Parameter Description
initialJoystickAlignment Initial joystick alignment relative to the joystick area, by default Alignment.bottomCenter.
child The child contained by the joystick area.

Customization

Square Joystick

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

Parameter Description
base Widget that renders joystick base, by default JoystickBase.
stick Widget that renders joystick stick, it places in the center of base widget, by default JoystickStick.
stickOffsetCalculator Calculate 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.

Donate

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

Buy Me A Coffee PayPal

flutter_joystick's People

Contributors

pavelzaichyk avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.