Comments (8)
I removed current
and currentIndex
from TapInfo
, because I don't know any practical use case for these values in TapInfo
.
However, beforeTap
and beforeTapIndex
are good name suggestions that I may include in a later release.
Thanks for the help. You created this issue at just the right time that the changes could still be added to version 0.8 🙂
from animated_toggle_switch.
The position
field of TapInfo
could benefit from a more extensive comment about what possible range for the values it could take: if we are tapping slightly on the left of 1st element, is it = to -1, or to 0 or -0.2? Or maybe the tapInfo is null? (same question for tapping on the right of last element)
Apart from that, the new structure is still understandable in my opinion.
from animated_toggle_switch.
Thanks for the feature request. I will change the onTap
method to pass a parameter. I'll comment again once I've implemented a first prototype of the feature.
Do you have any additional suggestions on what else to pass in this parameter besides the tapped value
and index
?
from animated_toggle_switch.
@OroshiX Could you take a look at my implementation of this feature? I would appreciate any feedback on this :)
from animated_toggle_switch.
Hey @maeddin , thanks for your quick reply and action. I had a look, and it is very nice! Also, you added some more info in this TapInfo
class that could definitely be useful. 👍
A comment on naming: I had a bit of a struggle understanding that current
was actually referring to the previous value before tapping, because as I see it, the TapInfo
refers to the tap action, so the word "current" would be IMO more about where we tapped right now. I would replace current
(and currentIndex
) with previous
(and previousIndex
). But this might be only my opinion 🙂
Other than this nitpick, the change seems good, and as a bonus, I could do exactly what I wanted to do, with limited changes to my code, so thank you very much 💪
from animated_toggle_switch.
Thanks for the detailed feedback 🙂
Yes, the naming of current
can be confusing, but previous
is also not true because a tap not necessarily triggers onChanged
and changes the value. I will think again how to name this best. Otherwise I can also remove current
, so it doesn't lead to confusion.
from animated_toggle_switch.
Maybe beforeTap
(and beforeTapIndex
) instead? It doesn't seem to imply a change on the value 🤔
Removing current
would also be fine by me, no strong opinion on my side.
from animated_toggle_switch.
@OroshiX I changed the parameters for onTap
a little bit. Is the new structure still somewhat understandable?
Sorry to bother you, but I need an opinion apart from my own 😅
from animated_toggle_switch.
Related Issues (20)
- Sometimes the toggle gets triggered two times HOT 6
- Point releases should not have breaking changes HOT 3
- Range error when dragging the indicator too far in right direction HOT 9
- Change icon or text color HOT 4
- translation example HOT 3
- foreground icon and background icon do mismatch by a few pixel HOT 2
- onchanged property always remains false HOT 9
- Indicator hide DecoratedBox hide while dragging HOT 12
- Feature Request: Ability to disable toggle switch HOT 2
- Ability to initialize with null/unselected value HOT 5
- Why is there no option to add an indicatorGradient in ToggleStyle? HOT 2
- problems with backgroundGradient and backgroundColor
- Theme switching occurs with a delay HOT 7
- Option to execute custom code after completion of animation HOT 2
- Setstate() called after dispose
- indicatorSize can't be changed HOT 2
- Indicator boxShadow is clipped HOT 4
- backgroundColor is displayed inaccurately. HOT 4
- Accessibility TalkBack for Android covers other switches, unable to read other tabs or select them. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from animated_toggle_switch.