Embedded Shape Drawing Support #31
Replies: 3 comments
-
A Flutter project that implemented differentiation between stylus and finger input would be this calendar app. Notably around this code section. |
Beta Was this translation helpful? Give feedback.
-
I would rather keep this project dependency free, and not use riverpod. Riverpod is good for a complex app, but for a package like this, where there isn't much state, basic state management using |
Beta Was this translation helpful? Give feedback.
-
Also I think this handled only in flutter-chessground, not an external app through callbacks. Not sure yet whether we should use a My guess is the |
Beta Was this translation helpful? Give feedback.
-
You wanted the users to be able to draw shapes by touching with one finger and moving the other. This is not possible using a gesture detector as far as I could tell, so a custom solution using listeners to touch events is necessary one way or another. Implementing this without Riverpod seems tedious, so I think the optimal solution would be to refactor it using callback functions provided by the app using flutter-chessground while providing a "default" GestureDetector to slot in which doesn't allow for drawing shapes natively.
When using Riverpod or at least callbacks, it is also possible to differentiate events by input device type, such as a stylus. This could allow for the users to draw shapes with a stylus while playing normally with fingers.
Beta Was this translation helpful? Give feedback.
All reactions