JoystickArea class

Allow to place the joystick in any place where user click. Just need to place other widgets as child of JoystickArea widget.

Inheritance

Constructors

JoystickArea({Key? key, Widget? child, Alignment initialJoystickAlignment = Alignment.bottomCenter, required StickDragCallback listener, Duration period = const Duration(milliseconds: 100), Widget? base, Widget stick = const JoystickStick(), JoystickMode mode = JoystickMode.all, StickOffsetCalculator stickOffsetCalculator = const CircleStickOffsetCalculator(), Function? onStickDragStart, Function? onStickDragEnd})
const

Properties

base Widget?
Widget that renders joystick base, by default JoystickBase.
final
child Widget?
The child contained by the joystick area.
final
hashCode int
The hash code for this object.
no setterinherited
initialJoystickAlignment Alignment
Initial joystick alignment relative to the joystick area, by default Alignment.bottomCenter.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
listener StickDragCallback
Callback, which is called with period frequency when the stick is dragged.
final
mode JoystickMode
Mode possible direction
final
onStickDragEnd Function?
Callback, which is called when the stick released.
final
onStickDragStart Function?
Callback, which is called when the stick starts dragging.
final
period Duration
Frequency of calling listener from the moment the stick is dragged, by default 100 milliseconds.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stick Widget
Widget that renders joystick stick, it places in the center of base widget, by default JoystickStick.
final
stickOffsetCalculator StickOffsetCalculator
Calculate offset of the stick based on the stick drag start position and the current stick position.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<JoystickArea>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited