I'm missing the (extension) functions isAnyOf(...) and isNoneOf(...) #55115
Labels
area-core-library
SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.
library-core
type-enhancement
A request for a change that isn't a bug
I have often the problem that I want to check if a value is one of a very limited list of options. In the past I wrote a extension function with a list of arguments which worked fine for me but was somehow award that this required a list. Now I found randomly a trick in
Object.hash(...)
which makes it almost perfect. Here is my suggestion for an extension which should be part of dart out of my view:Usage sample:
I'm curious what you think about it.
The text was updated successfully, but these errors were encountered: