You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The other two coerce methods do the same thing as min() and max(). Maybe your methods are slightly easier to understand, but min and max are so common in other programming languages that keeping the convention might be more important than introducing a second way to do the same thing. If you still want to keep the methods maybe you could at least change the implementation to use min / max instead of the more verbose comparison.
The text was updated successfully, but these errors were encountered:
I did not even know clamp() existed. I'm not sure about how to move forward. Many users come from Kotlin and maybe we should keep some duplicates for them.
If I understand coerceIn correctly it does the same thing as num.clamp:
https://api.dartlang.org/stable/2.7.0/dart-core/num/clamp.html
The other two coerce methods do the same thing as min() and max(). Maybe your methods are slightly easier to understand, but min and max are so common in other programming languages that keeping the convention might be more important than introducing a second way to do the same thing. If you still want to keep the methods maybe you could at least change the implementation to use min / max instead of the more verbose comparison.
The text was updated successfully, but these errors were encountered: