Hey stupid question but how do I use the new State...
# coroutines
v
Hey stupid question but how do I use the new StateFlow? Im using kotlin version 1.3.72 but it doesnt seem to have StateFlow
o
Flows/coroutines are part of the coroutines library, you need to have that
v
so I thought that initially, however I dont have those libraries in my project but I still have access to most coroutines stuff (Dispatches, Channels, Flows etc)
just not StateFlow
o
you probably have it under the
experimental
package
or something else is putting it on your classpath
v
Its under the kotlinx pacakge
is that the same thing?
o
the official package is
kotlinx.coroutines
v
kotlinx.coroutines.flow for example
o
yes, that's official
v
yes I already have that then
o
so it sounds like something else is putting it on your classpath
v
🤔 any idea what would be doing that?
o
check with your build tool
v
do any of the jetpack libraries do that for some reason?
o
oh, android? something probably does
check
gradle dependencies
v
ya sorry this is in Android. In my dependencies, I dont have the coroutines library specifically
but I have a lot of google libraries
maybe its a transitive dependency?
anyway, which of the listed dependencies do I actually need for stateflow?
just the core package?
o
just the core one
and when I said,
gradle dependencies
, I meant to run that command
it will print out transitive dependencies too
v
ok ill run it and see. Thanks for the help, I thought coroutines came standard with kotlin for some reason
o
nope, just the
suspend
modifier
v
ya turns out it was google libraries that use it
a
StateFlow is in version 1.3.6/7 and above I believe