https://kotlinlang.org logo
Docs
Join the conversationJoin Slack
Channels
100daysofcode
100daysofkotlin
100daysofkotlin-2021
advent-of-code
aem
ai
alexa
algeria
algolialibraries
amsterdam
android
android-architecture
android-databinding
android-studio
androidgithubprojects
androidthings
androidx
androidx-xprocessing
anime
anko
announcements
apollo-kotlin
appintro
arabic
argentina
arkenv
arksemdevteam
armenia
arrow
arrow-contributors
arrow-meta
ass
atlanta
atm17
atrium
austin
australia
austria
awesome-kotlin
ballast
bangladesh
barcelona
bayarea
bazel
beepiz-libraries
belgium
berlin
big-data
books
boston
brazil
brikk
budapest
build
build-tools
bulgaria
bydgoszcz
cambodia
canada
carrat
carrat-dev
carrat-feed
chicago
chile
china
chucker
cincinnati-user-group
cli
clikt
cloudfoundry
cn
cobalt
code-coverage
codeforces
codemash-precompiler
codereview
codingame
codingconventions
coimbatore
collaborations
colombia
colorado
communities
competitive-programming
competitivecoding
compiler
compose
compose-android
compose-desktop
compose-hiring
compose-ios
compose-mp
compose-ui-showcase
compose-wear
compose-web
connect-audit-events
corda
cork
coroutines
couchbase
coursera
croatia
cryptography
cscenter-course-2016
cucumber-bdd
cyprus
czech
dagger
data2viz
databinding
datascience
dckotlin
debugging
decompose
decouple
denmark
deprecated
detekt
detekt-hint
dev-core
dfw
docs-revamped
dokka
domain-driven-design
doodle
dsl
dublin
dutch
eap
eclipse
ecuador
edinburgh
education
effective-kotlin
effectivekotlin
emacs
embedded-kotlin
estatik
event21-community-content
events
exposed
failgood
fb-internal-demo
feed
firebase
flow
fluid-libraries
forkhandles
forum
fosdem
fp-in-kotlin
framework-elide
freenode
french
fritz2
fuchsia
functional
funktionale
gamedev
ge-kotlin
general-advice
georgia
geospatial
german-lang
getting-started
github-workflows-kt
glance
godot-kotlin
google-io
gradle
graphic
graphkool
graphql
graphql-kotlin
graviton-browser
greece
grpc
gsoc
gui
hackathons
hacktoberfest
hamburg
hamkrest
helios
helsinki
hexagon
hibernate
hikari-cp
hire-me
hiring
hongkong
hoplite
http4k
hungary
hyderabad
image-processing
india
indonesia
inkremental
intellij
intellij-plugins
intellij-tricks
internships
introduce-yourself
io
ios
iran
israel
istanbulcoders
italian
jackson-kotlin
jadx
japanese
jasync-sql
java-to-kotlin-refactoring
javadevelopers
javafx
javalin
javascript
jdbi
jhipster-kotlin
jobsworldwide
jpa
jshdq
juul-libraries
jvm-ir-backend-feedback
jxadapter
k2-early-adopters
kaal
kafka
kakao
kalasim
kapt
karachi
karg
karlsruhe
kash_shell
kaskade
kbuild
kdbc
kgen-doc-tools
kgraphql
kinta
klaxon
klock
kloudformation
kmdc
kmm-español
kmongo
knbt
knote
koalaql
koans
kobalt
kobweb
kodein
kodex
kohesive
koin
koin-dev
komapper
kondor-json
kong
kontent
kontributors
korau
korean
korge
korim
korio
korlibs
korte
kotest
kotest-contributors
kotless
kotlick
kotlin-asia
kotlin-beam
kotlin-by-example
kotlin-csv
kotlin-data-storage
kotlin-foundation
kotlin-fuel
kotlin-in-action
kotlin-inject
kotlin-latam
kotlin-logging
kotlin-multiplatform-contest
kotlin-mumbai
kotlin-native
kotlin-pakistan
kotlin-plugin
kotlin-pune
kotlin-roadmap
kotlin-samples
kotlin-sap
kotlin-serbia
kotlin-spark
kotlin-szeged
kotlin-website
kotlinacademy
kotlinbot
kotlinconf
kotlindl
kotlinforbeginners
kotlingforbeginners
kotlinlondon
kotlinmad
kotlinprogrammers
kotlinsu
kotlintest
kotlintest-devs
kotlintlv
kotlinultimatechallenge
kotlinx-datetime
kotlinx-files
kotlinx-html
kotrix
kotson
kovenant
kprompt
kraph
krawler
kroto-plus
ksp
ktcc
ktfmt
ktlint
ktor
ktp
kubed
kug-leads
kug-torino
kvision
kweb
lambdaworld_cadiz
lanark
language-evolution
language-proposals
latvia
leakcanary
leedskotlinusergroup
lets-have-fun
libgdx
libkgd
library-development
linkeddata
lithuania
london
losangeles
lottie
love
lychee
macedonia
machinelearningbawas
madrid
malaysia
mathematics
meetkotlin
memes
meta
metro-detroit
mexico
miami
micronaut
minnesota
minutest
mirror
mockk
moko
moldova
monsterpuzzle
montreal
moonbean
morocco
motionlayout
mpapt
mu
multiplatform
mumbai
munich
mvikotlin
mvrx
myndocs-oauth2-server
naming
navigation-architecture-component
nepal
new-mexico
new-zealand
newname
nigeria
nodejs
norway
npm-publish
nyc
oceania
ohio-kotlin-users
oldenburg
oolong
opensource
orbit-mvi
osgi
otpisani
package-search
pakistan
panamá
pattern-matching
pbandk
pdx
peru
philippines
phoenix
pinoy
pocketgitclient
polish
popkorn
portugal
practical-functional-programming
proguard
prozis-android-backup
pyhsikal
python
python-contributors
quasar
random
re
react
reaktive
realm
realworldkotlin
reductor
reduks
redux
redux-kotlin
refactoring-to-kotlin
reflect
refreshversions
reports
result
rethink
revolver
rhein-main
rocksdb
romania
room
rpi-pico
rsocket
russian
russian_feed
russian-kotlinasfirst
rx
rxjava
san-diego
science
scotland
scrcast
scrimage
script
scripting
seattle
serialization
server
sg-user-group
singapore
skia-wasm-interop-temp
skrape-it
slovak
snake
sofl-user-group
southafrica
spacemacs
spain
spanish
speaking
spek
spin
splitties
spotify-mobius
spring
spring-security
squarelibraries
stackoverflow
stacks
stayhungrystayfoolish
stdlib
stlouis
strife-discord-lib
strikt
students
stuttgart
sudan
swagger-gradle-codegen
swarm
sweden
swing
swiss-user-group
switzerland
talking-kotlin
tallinn
tampa
teamcity
tegal
tempe
tensorflow
terminal
test
testing
testtestest
texas
tgbotapi
thailand
tornadofx
touchlab-tools
training
tricity-kotlin-user-group
trójmiasto
truth
tunisia
turkey
turkiye
twitter-feed
uae
udacityindia
uk
ukrainian
uniflow
unkonf
uruguay
utah
uuid
vancouver
vankotlin
vertx
videos
vienna
vietnam
vim
vkug
vuejs
web-mpp
webassembly
webrtc
wimix_sentry
wwdc
zircon
Powered by Linen
android
  • a

    Alexander Suraphel

    04/14/2022, 1:29 PM
    I just upgraded AGP to 7.1.3 and Compose 1.0.5 no longer works saying
    This version (1.0.5) of the Compose Compiler requires Kotlin version 1.5.31 but you appear to be using Kotlin version 1.6.0
    But my root
    build.gradle
    specifies
    ext.kotlin_version = '1.5.31'
    . Am I missing something?
    f
    e
    • 3
    • 10
  • r

    Radoslaw Juszczyk

    04/15/2022, 8:21 AM
    Hello guys, why does google discourage use of `Channel`s to pass UI Events from the VM to the UI ? Note: In some apps, you might have seen ViewModel events being exposed to the UI using Kotlin Channels or other reactive streams. These solutions usually require workarounds such as event wrappers in order to guarantee that events are not lost and that they're consumed only once. I dont see a problem with that, while I see a threat of Ui Events being dropped if we use
    SharedFlow
    (event is sent while the UI is not collecting).
    🤔 1
    l
    r
    a
    • 4
    • 18
  • j

    Joshua Akinsola

    04/16/2022, 11:02 AM
    This is a bit of a random one, I saw before on an app they would auto trim videos once you share it. E.g. a 5 min video once shared would be mashed up into a 1 min highlight but it would still sort of make sense (Maybe used some AI), is there a package or a way to build something similar that anyone knows?
    :not-kotlin: 3
    u
    • 2
    • 1
  • r

    Remon Shehata

    04/16/2022, 8:19 PM
    How can I test sealed classes in Kotlin? for example I have
    sealed class LoginResult {
        object Success : LoginResult()
        object WrongCredentials : LoginResult()
        data class InvalidData(val error: ErrorType) : LoginResult()
    }
    
    sealed class ErrorType {
        object EmptyEmail : ErrorType()
        object InvalidEmailFormat : ErrorType()
        object EmptyPassword : ErrorType()
    }
    how can I assert that I got the result of
    InvalidData
    with the error of
    EmptyEmail
    ?
    l
    r
    • 3
    • 11
  • h

    Hiren Kuvadiya

    04/17/2022, 5:42 AM
    Hello friends, I am getting this error while writing unittesting "java.lang.RuntimeException: Method getMainLooper in android.os.Looper not mocked." Dows anybody have idea what is the cause of it and how to fix it? I am sharing the code in screenshot given below
    :not-kotlin: 2
    c
    • 2
    • 3
  • l

    Lilly

    04/17/2022, 11:56 AM
    Why does Android Studio warn about
    freeCompilerArgs += listOf()
    ("creates new list under the hood") and suggests to change it to
    freeCompilerArgs = freeCompilerArgs + listOf()
    , I mean both create a new list?! Or does it warn because it's not obvious that a new list is created at first glance while the latter version is more explicit?
    a
    • 2
    • 1
  • c

    Can Korkmaz

    04/19/2022, 5:35 AM
    Hello everyone, I'm having strange problems with retrofit with moshi and hilt. It either gives the error expecteed Begin_array but found begin_Object, even though I had an array of json objects in the link, or other problems such as malformed json, all fields null response. I'm sharing only the dependency module here (moshi and retrofit instances) and rest will be placed in thread.
    @Module
    @InstallIn(SingletonComponent::class)
    object DependencyModule {
    
        @Singleton
        @Provides
        fun provideMoshi(): Moshi = Moshi.Builder().add(KotlinJsonAdapterFactory()).build()
    
        @Singleton
        @Provides
        fun provideRetrofit(moshi: Moshi): BackendApi = Retrofit.Builder()
            .addConverterFactory(MoshiConverterFactory.create(moshi))
            .baseUrl(Constants.BASE_URL)
            .build()
            .create(BackendApi::class.java)
    }
    m
    c
    • 3
    • 13
  • m

    Manikandan

    04/19/2022, 2:18 PM
    Hey Every one I'm beginner to learn Android studio Guide me to how to learn properly and easily Anyone kindly guide me to good Android studio application developer
    :not-kotlin: 6
    c
    • 2
    • 1
  • a

    Ahmed Shehata

    04/20/2022, 5:20 AM
    #compose I'm using paging 3 with compose to display a lazy list and I can display loading, error and refreshing states but my problem that I want to display an empty view when there is no data (list size = 0)
    @Composable
    fun HandlePagingError( loadState: CombinedLoadStates, onNoInternet: @Composable () -> Unit = {}, onEmptyView: @Composable () -> Unit = {} ) { when { loadState.refresh is LoadState.Loading -> { CircleLoading(loadingState = true, circleSize = 20.dp) } loadState.append is LoadState.NotLoading && loadState.append.endOfPaginationReached -> { onEmptyView() } loadState.append is LoadState.Loading -> { CircleLoading(loadingState = true, circleSize = 20.dp) } loadState.refresh is LoadState.Error -> { // val e = loadState.append as LoadState.Error onNoInternet() } loadState.append is LoadState.Error -> { val e = loadState.append as LoadState.Error val v = loadState.append.endOfPaginationReached Log.i("HandlePagingError: ", v.toString()) val error = getNetworkErrorFromThrowable(e.error) val messageError = when (error) { is Result.NetworkError.Generic -> getErrorType(error.type) Result.NetworkError.NoInternet -> stringResource(id = R.string.error_no_more_data) } TextUi( modifier = Modifier.fillMaxWidth(), text = messageError, textAlign = TextAlign.Center ) } } }
    f
    • 2
    • 2
  • n

    Nandu

    04/20/2022, 6:17 AM
    Hi All, I have written an Android library in Kotlin which calls the C++ library which makes all the network calls. I have build MyLibraryLib as JNI wrapper and exposed them as suspend function and Added another wrapper MyLibraryClient on top of this JNI to expose as normal function. Inside which I am calling these suspend functions in GlobalScope.launch/returnBlocking so that MyLibraryClient can be used by Java code. What I understood is GlobalScope.launch/runBlocking is not supposed to be used for this purpose. My objective is to write a library which will take care of running the CPU or IO operation on the IO thread and return the results back on the main thread so that the Java/Kotlin caller need not worry about the threading and simply call my library function. e.g. MyLibraryLib looks something like this suspend fun getProfile(): Response{ returnWithContext(Dispatchers.IO){ val response = ProfileResponse() getProfile(response) // It’s an JNI function return@withContext response } } MyLibraryClient looks something like this fun getProfile(): Response{ return runBlocking{ val response = async{ MyLibraryLib.getProfile() } return@runBlocking response.await() } }
    p
    • 2
    • 7
  • l

    lam bui

    04/20/2022, 9:17 AM
    val caption : String? = null 
    val caption : String? = ""
    should I use option 1 or 2 to initialize a variable?
    c
    c
    • 3
    • 2
  • c

    Colton Idle

    04/20/2022, 11:31 PM
    Alright, I think I finally have an Android + Kotlin related question! I'm using Firebase's firestore, and it basically has this ability to listen to continuous updates to your query. Unfortunately there's no modern kotlin version of this. "Old" callback based example:
    val docRef = db.collection("cities").document("SF")
    docRef.addSnapshotListener { snapshot, e ->
        if (e != null) {
            Log.w(TAG, "Listen failed.", e)
            return@addSnapshotListener
        }
    
        if (snapshot != null && snapshot.exists()) {
            Log.d(TAG, "Current data: ${snapshot.data}")
        } else {
            Log.d(TAG, "Current data: null")
        }
    }
    How would you take this callback/listener and convert it into a main safe flowable?
    e
    k
    +2
    • 5
    • 27
  • k

    kuz

    04/21/2022, 6:47 AM
    Does kotlin have no compilation options to help me generate an exact same bytecode with Java?
    e
    • 2
    • 2
  • l

    lam bui

    04/21/2022, 8:11 AM
    fun main(args: Array<String>) {
        val list = mutableListOf(
            DemandLabel(
                id = "1",
                inputType = Constants.DemandLabelInputType.RADIO,
                type = Constants.DemandLabelType.DEFAULT,
                uniqueCode = "duration",
                name = "duration",
                items = listOf(
                    DemandLabelItem(
                        id = "1ab", name = "5 min"
                    ), DemandLabelItem(
                        id = "123abc", name = "10 min"
                    )
                )
            ),
            DemandLabel(
                id = "2",
                inputType = Constants.DemandLabelInputType.RADIO,
                type = Constants.DemandLabelType.DEFAULT,
                uniqueCode = "level",
                name = "level",
                items = listOf(
                    DemandLabelItem(
                        id = "2ab", name = "Beginner"
                    ), DemandLabelItem(
                        id = "2bc", name = "All"
                    )
                )
            ),
            DemandLabel(
                id = "3",
                inputType = Constants.DemandLabelInputType.RADIO,
                type = Constants.DemandLabelType.DEFAULT,
                uniqueCode = "Label 1",
                name = "Label 1",
                items = listOf(
                    DemandLabelItem(
                        id = "3abc", name = "Adductors"
                    ), DemandLabelItem(
                        id = "3abcdeft", name = "Calves"
                    )
                )
            ),
            DemandLabel(
                id = "4",
                inputType = Constants.DemandLabelInputType.CHECKBOX,
                type = Constants.DemandLabelType.CUSTOM,
                uniqueCode = "Label 2",
                name = "Label 2",
                items = listOf(
                    DemandLabelItem(
                        id = "4abc", name = "Abdominals2"
                    ), DemandLabelItem(
                        id = "4abcdef", name = "Arms2"
                    )
                )
            ),
        )
        val mapOfList = list.associateBy({ it.name }, { it.items })
        println(mapOfList)
    
        val changed = list.groupBy (
            { it.name },
            {it.items.forEach { it.id }} )
        println(changed)
    }
    :thread-please: 2
    • 1
    • 2
  • l

    Lilly

    04/21/2022, 10:29 AM
    Lets say I have following business layer function:
    fun someFunction(): Flow<Pair<Int, SomeStateType>>
    Would you 1. define a data class and create a new object on every change (this might happen 100x). Disadvantage: object creation on every change, advantage: state is coupled to its function 2. expose 2 observable
    StateFlows
    . Disadvantage: pollutes interface API, advantage: no object creation on every change Is there any guidance about this or is this an issue of preference?
    j
    c
    +2
    • 5
    • 8
  • h

    hfhbd

    04/21/2022, 2:09 PM
    What are the drawbacks if a dependency uses an older AGP version, eg 4.1, but I use 7.x?
    e
    • 2
    • 5
  • d

    David Corrado

    04/21/2022, 3:16 PM
    Is it possible to have kotlin Result be exhaustive it seems to hide Success and Failure so I want to basically do something like this within a extension function
    fun <T> Result<T>.toDataState(): DataState<T> {
        onFailure {
            return DataState.failure()
        }.onSuccess {
            return DataState.success(it)
        }
    }
    But you can not because onFailure and onSuccess is not exhaustive. How have you done this?
    c
    e
    m
    • 4
    • 3
  • v

    Vivek Modi

    04/21/2022, 9:04 PM
    Hey I want to synchronized api in android. I am using interceptor in android. When I am calling api and I get 401 status, I am refreshing my token api which is not calling. Can someone help me how to call refresh api when I used synchronized in kotlin. AuthorizationInterceptor.kt
    class AuthorizationInterceptor : Interceptor {
     
         override fun intercept(chain: Interceptor.Chain): Response {
             // more code
             return AuthorizationHeader(chain, accessToken)
         }
     
     
         private fun AuthorizationHeader(chain: Interceptor.Chain, accessToken: String): Response = synchronized(this) {
             val api = refreshApiCall() // this api call is not working
             return initialResponse
         }
     }
    l
    i
    • 3
    • 11
  • n

    Nurbanu Kahraman

    04/21/2022, 9:20 PM
    hello everyone, do you have any training you would recommend for a newbie to the kotlin language?
    m
    c
    • 3
    • 2
  • z

    Zoltan Demant

    04/22/2022, 6:09 AM
    (Notifications) Does anyone know what the behavior would be if a foreground service is showing a notification, and is then stopped after N time - but its notification is updated shortly after the stop call? - Would it dismiss the notification (as expected)? - Or, would the notification be updated, and stick around even though the service is destroyed?
    :not-kotlin: 2
    r
    • 2
    • 2
  • v

    Vivek Modi

    04/22/2022, 9:29 AM
    Hey guys, How can we improve this piece of code
    private fun getMonthValue(subscription: VariantDetail, context: Context): String {
        return when (subscription.valueInInt) {
            0 -> ""
            1 -> {
                when ((UnitOfMeasurement.fromType(subscription.unitOfMeasurement))) {
                    MONTH -> context.getString(R.string.singular_month)
                    DAY -> context.getString(R.string.singular_day)
                    WEEK -> context.getString(R.string.singular_week)
                    QUARTERLY,
                    DOSE,
                    NONE -> ""
                }
            }
            else -> {
                when ((UnitOfMeasurement.fromType(subscription.unitOfMeasurement))) {
                    MONTH -> {
                        context.getString(
                            R.string.month_text,
                            subscription.value,
                            context.getString(R.string.plural_month)
                        )
                    }
                    DAY -> {
                        context.getString(
                            R.string.month_text,
                            subscription.value,
                            context.getString(R.string.plural_day)
                        )
                    }
                    WEEK -> {
                        context.getString(
                            R.string.month_text,
                            subscription.value,
                            context.getString(R.string.plural_week)
                        )
                    }
                    QUARTERLY,
                    DOSE,
                    NONE -> ""
                }
            }
        }
    }
    c
    • 2
    • 2
  • c

    Chaiwa Berian

    04/22/2022, 11:56 AM
    Hey guys. I know a little bit about
    qualified this
    but I am trying to wrap my brains around this syntax right here:
    Observer { loginFormState ->
                    if (loginFormState == null) {
                        return@Observer
                    }
                    loginButton.isEnabled = loginFormState.isDataValid
                    loginFormState.usernameError?.let {
                        usernameEditText.error = getString(it)
                    }
                    loginFormState.passwordError?.let {
                        passwordEditText.error = getString(it)
                    }
                })
    I understand the rest of the code except what is happening here:
    if (loginFormState == null) {
         return@Observer
      }
    What would be the interpretation of what
    return@Observer
    mean? Semantics?
    e
    • 2
    • 16
  • s

    Slackbot

    04/24/2022, 9:55 AM
    This message was deleted.
    :stackoverflow: 2
    :not-kotlin: 2
    c
    • 2
    • 1
  • w

    wck

    04/26/2022, 7:01 AM
    Hi all, would Kotlin Reflection ever support Composable functions?
    Function References of @Composable functions are not currently supported
    a
    • 2
    • 1
  • a

    althaf

    04/27/2022, 11:47 AM
    Hi in the view model , would it be possible to call same use case with different values and listen to them separately ? flowing code is the idea that i'm trying to achinve. however can't figure out a neat way to do this
    private val onLiveFxRateResult: LiveData<Result<List<FundingAccountWithCcyPair>>> =
        Transformations.switchMap(onLiveFxRateRequested) {
            it.forEach {
                getFundingAccountsWithCcyPairsUseCase.execute(it.accountCountryCode)
            }
        }
    j
    • 2
    • 2
  • s

    Simon Stahl

    04/27/2022, 9:04 PM
    Hi there. I wonder if it is a good idea to use a
    MutableSharedFlow
    as an app wide event bus for a reactive architecture. Does anything speak against it? Does it stay stable if the app is kept open all day long and is repeatedly put into foreground/background?
    🇳🇴 1
    a
    c
    • 3
    • 11
  • j

    Julia Samól

    04/28/2022, 10:50 AM
    Hi! Is it possible to implement an interface by delegation in a value class? This doesn’t work:
    interface I
    
    @JvmInline
    value class A(val instance: I) : I by instance // Error: Value class cannot implement an interface by delegation if expression is not a parameter
    and I’m wondering whether value classes lack that feature or I’m the one missing something here
    j
    • 2
    • 5
  • a

    althaf

    04/28/2022, 11:31 AM
    Hi , is there way to make this code more cute ?
    val index = liveFxRates.indexOfFirst { result.data.isCurrencyPairEqual(fxLiveRateGainLoss =  it) }
    if(index > -1) {
        liveFxRates.removeAt(index)
        liveFxRates.add(index, liveFxRates[index].copy(buyValue = "-", sellValue = "-"))
    }
    g
    • 2
    • 2
  • p

    Pablo

    04/28/2022, 3:15 PM
    Is there any idiomatic way to having a List<String> and Map<String,Boolean> check if map contains any key of the List<String>?
    r
    g
    • 3
    • 3
  • l

    lawlorslaw

    04/29/2022, 6:26 PM
    Is there a cleaner way to do this in Coroutines, possibly using
    flatmap()
    or some functional operator, without having to introduce Kotlin Flows?
    viewModelScope.launch {
      val api = NetworkService().api
      val ordersResponse = api.fetchOrdersCoroutine()
      val deliveryItems = mutableListOf<DeliveryItem>()
      ordersResponse.orders.forEach { orderId ->
        val orderResponse = api.fetchOrderByIdCoroutine(orderId)
        deliveryItems.addAll(orderResponse.items)
      }
    }
    m
    • 2
    • 2
Powered by Linen
Title
l

lawlorslaw

04/29/2022, 6:26 PM
Is there a cleaner way to do this in Coroutines, possibly using
flatmap()
or some functional operator, without having to introduce Kotlin Flows?
viewModelScope.launch {
  val api = NetworkService().api
  val ordersResponse = api.fetchOrdersCoroutine()
  val deliveryItems = mutableListOf<DeliveryItem>()
  ordersResponse.orders.forEach { orderId ->
    val orderResponse = api.fetchOrderByIdCoroutine(orderId)
    deliveryItems.addAll(orderResponse.items)
  }
}
m

Matt Rea

04/29/2022, 6:44 PM
map { }
would work here. Doesn't really matter that its in a coroutine
val api = NetworkService().api

val deliveryItems = api.fetchOrdersCoroutine().orders.map { order ->
    api.fetchOrderByIdCoroutine(order.id)
}
l

lawlorslaw

04/29/2022, 6:49 PM
thanks. this is helpful
🚀 2
View count: 7