Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wearable_rotary] Add a RotatoryDetector widget #544

Open
alestiago opened this issue Mar 14, 2023 · 7 comments
Open

[wearable_rotary] Add a RotatoryDetector widget #544

alestiago opened this issue Mar 14, 2023 · 7 comments

Comments

@alestiago
Copy link

alestiago commented Mar 14, 2023

Description

As a Flutter developer I'm used to using a GestureDetector to listen to user gesture inputs. Where I pass callbacks and I don't have to deal with disposing controllers.

I would like to have a RotatoryDetector widget or similar that allows me listening to events with an API similar to the one offered by GestureDetector.

For example:

RotatoryDetector(
  onRotate: (details) => {},
);

I would expect the details to have information such as RotatoryDirection and other values available with a RotatoryScrollController.

I think the API is opened for discussion. I'm willing to contribute once agreed on a solution. Thanks for this plugin.

[Issue opened on wearable_rotary 2.0.0]

@renancaraujo
Copy link

Rather than a Gesture detector, this should be more like a keyboard input since focus could affect the targeting of the input rather than HitTesting.
In other words, the proposed widget should contain/receive a FocusNode to define if it should accept the input.

@swift-kim
Copy link
Member

Hi. I like the idea of creating a dedicated widget to treat rotation events like key events.

cc @Rexios80 Do you happen to have any specific comments on this?

@Rexios80
Copy link
Contributor

What's the use-case for this that a StreamBuilder can't handle?

@renancaraujo
Copy link

Cases in which rotary events shouldn't trigger a widget rebuild directly.
It is an event semantically closer to gesture and keyboard events, not network or things coming from state management layers.

@Rexios80
Copy link
Contributor

I strongly disagree with putting things like this in the widget tree, but it's not my place to tell other developers how to write their code. If other developers are going to want this, I don't have an issue with adding it.

@renancaraujo
Copy link

User input logic IS user interface logic. I'm afraid I have to disagree with putting things like this outside the widget tree.

@swift-kim
Copy link
Member

I don't have a specific opinion but if you think it's appropriate, please feel free to contribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants