Skip to content

Commit

Permalink
Add a parameter for arrows visibility
Browse files Browse the repository at this point in the history
Closes #6
  • Loading branch information
artur-ios-dev committed Jun 24, 2019
1 parent fa6d9d5 commit 918d8ea
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lib/views/joystick_view.dart
Expand Up @@ -25,6 +25,13 @@ class JoystickView extends StatelessWidget {
*/
final Duration interval;

/**
* Shows top/right/bottom/left arrows on top of Joystick
*
* Defaults to [true]
*/
final bool showArrows;

/// Date when was the [onDirectionChanged] called the last time
///
/// It's set to proepr value on [onDirectionChanged] call
Expand All @@ -35,7 +42,8 @@ class JoystickView extends StatelessWidget {
{this.size,
this.iconsColor = Colors.white54,
this.onDirectionChanged,
this.interval = null});
this.interval = null,
this.showArrows = true});

@override
Widget build(BuildContext context) {
Expand Down Expand Up @@ -90,7 +98,7 @@ class JoystickView extends StatelessWidget {
top: joystickInnerPosition.dy,
left: joystickInnerPosition.dx,
),
...createArrows(),
if (showArrows) ...createArrows(),
],
),
);
Expand Down

0 comments on commit 918d8ea

Please sign in to comment.