Code Monkey home page Code Monkey logo

flutter_control_pad's People

Contributors

artur-ios-dev avatar dudeck avatar jairajjangle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

flutter_control_pad's Issues

Getting a stream from the joystick view

Is there a way I can get a continues stream of data(angle and distance) from the joystick view instead of just the angle and distance when there is a change in the joystick position?

[IMPROVEMENT] Use a "throttle" instead of using a DateTime variable for interval

The original post suggested to use Debouncer although it makes more sense to use Throttler since debouncer would send only last event after X time since the last event.


Acceptance Criteria:

  • refactor Joystick to use throttle mechanism instead of using DateTime variable
  • callback onDirectionChanged should be called not more often than the given time

I forgot to mention, please use the debouncer class instead of checking for interval by datetime. Currently the IDE shows a warning because the datetime is not immutable. If you like I can provide the code of how is can be implemented..

Originally posted by @gitboss in #11 (comment)

Custom arrows

Configurable arrows on the control pad to add other actions.

Joystick x and y

How to get the x and y of the joystick? there are only two results on directionchanged.

Works on stable channel

The code works with stable channel as well by getting the local position using the following code :

RenderBox getBox = context.findRenderObject();
getBox.globalToLocal(details.globalPosition))

Can you please confirm if the offsets received with the above code are correct?

localPosition error

Hi.
I'm trying using this joystick to test.
However, I cannot build JoystickView() because of an error.

Error is :
The getter 'localPosition' isn't defined for the class 'DragUpdateDetails'

There is no 'localPosition' variable in DragUpdateDetails.
The error occurs on details.localPosition in joystick_view.dart
Are you going to fix this error?
Thank you!

more Y stages?

Is it possible to create more stages than 0, 0.5, 1.0? I've used this in an app where I'm controlling motors to drive. I would love a function where I can drive my motors faster / slower according to the Y value of the control pad.

Thanks in advance

Using Control inside of GestureDetector

I'v noticed that when using this widget inside of an other gesture detector the Gesture Manager Arena will choose the Horizontal or Vertical Gesture before the Pan gesture of the Joystick.

I did some digging, looks like a possible solution is to Build a CustomPanGestureRecognizer within a RawGestureDetector. I tried implementing this but was unsuccessful due to my lack of understanding off GestureDetection in flutter. Here is a starting point that might help you. I'd be very interested in seeing this through as it relies on a rather large project I am building.

The Joy Stick View is within a multipage application and I use Flutter Swiper to navigate between pages.

You can see from the log that the Pan is winner when the gesture is a Verical Direction, but when it is in a Horizontal Direction the Pan does not win.

Here is a log of the Arena Manager
I/flutter (24667): Gesture arena 1271 ❙ ★ Opening new gesture arena. I/flutter (24667): Gesture arena 1271 ❙ Adding: PanGestureRecognizer#d3ee9(debugOwner: GestureDetector, start behavior: start) I/flutter (24667): Gesture arena 1271 ❙ Adding: HorizontalDragGestureRecognizer#1757e(start behavior: start) I/flutter (24667): Gesture arena 1271 ❙ Adding: TapGestureRecognizer#9cb38(debugOwner: GestureDetector, state: ready, button: 1) I/flutter (24667): Gesture arena 1271 ❙ Closing with 3 members. I/flutter (24667): Gesture arena 1271 ❙ Rejecting: TapGestureRecognizer#9cb38(debugOwner: GestureDetector, state: possible, button: 1) I/flutter (24667): Gesture arena 1271 ❙ Accepting: PanGestureRecognizer#d3ee9(debugOwner: GestureDetector, start behavior: start) I/flutter (24667): Gesture arena 1271 ❙ Self-declared winner: PanGestureRecognizer#d3ee9(debugOwner: GestureDetector, start behavior: start) D/ViewRootImpl@a3d787b[MainActivity](24667): ViewPostIme pointer 1 D/ViewRootImpl@a3d787b[MainActivity](24667): ViewPostIme pointer 0 I/flutter (24667): Gesture arena 1272 ❙ ★ Opening new gesture arena. I/flutter (24667): Gesture arena 1272 ❙ Adding: PanGestureRecognizer#d3ee9(debugOwner: GestureDetector, start behavior: start) I/flutter (24667): Gesture arena 1272 ❙ Adding: HorizontalDragGestureRecognizer#1757e(start behavior: start) I/flutter (24667): Gesture arena 1272 ❙ Adding: TapGestureRecognizer#9cb38(debugOwner: GestureDetector, state: ready, button: 1) I/flutter (24667): Gesture arena 1272 ❙ Closing with 3 members. I/flutter (24667): Gesture arena 1272 ❙ Rejecting: TapGestureRecognizer#9cb38(debugOwner: GestureDetector, state: possible, button: 1, sent tap down) I/flutter (24667): Gesture arena 1272 ❙ Accepting: HorizontalDragGestureRecognizer#1757e(start behavior: start) I/flutter (24667): Gesture arena 1272 ❙ Self-declared winner: HorizontalDragGestureRecognizer#1757e(start behavior: start)

[FEATURE] Add a configurable interval parameter

It should be possible to pass a Duration parameter which will indicate how often the events are registered (callback is called).

Acceptance criteria:

  • Add a final Duration interval to the JoystickView
  • _processGesture in the onPanUpdate callback should be called only when the last gesture was processed earlier than frequency's value
  • Proper documentation for the new method is written

Scale control pad

Hello,
can I scale the control pad? I would like to use a smaller one.

[FEATURE] Add a parameter for arrows visibility

add final bool in a JoystickView that will indicate if arrows should be shown on the top of the Joystick.

Acceptance criteria:

  • Arrows can be shown
  • Arrows can be hidden
  • Proper documentation for the new parameter is written
  • It should be optional (defaults to visible)

[FEATURE] Add ButtonsView

ButtonsView will be a view that can contain 1 or more buttons with configurable action (callback). It should be possible to choose either a grid or a circular layout for the buttons.

The joystickInnerPosition will move to the center point

Hi.
When I call setstate on my StatefulWidget, the joystickInnerPosition of the JoystickView returns to the center point.

Timer.periodic(Duration(milliseconds: 500), (as) {
	if (mounted) {
	  setState(() {
		_carState = _carState;
	  });
	}
});

Update Readme, Teach using its controller

Hi there!
I'm new at flutter and I'm wondering to know how can I use its controller in flutter, Could you please enrich your example via how to use its controller?

Animated Positioning

If you were to use an AnimatedPositioned widget on your joystick the effects would look more realistic when the joystick was returning to center

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.