Thread
#compose
    Spikey Sanju

    Spikey Sanju

    1 year ago
    Hi guys, how to send data class as an arguments instead of each type in the data class? P.S -> I'm having list of items in home screen when onClick I need to pass the data as a class!
    Spikey Sanju

    Spikey Sanju

    1 year ago
    Colton Idle

    Colton Idle

    1 year ago
    Yeah. I like the way that Ian Lake puts it. You should think of actions like urls and you would pass an id in a url, not the entire object.
    Arkadii Ivanov

    Arkadii Ivanov

    1 year ago
    It is very questionable. This implies that you have persistent storage. But you may not need one, and perhaps navigation should not be the only reason of introducing one. E.g. the app may be fully online (like Uber Eats). Ability to pass objects between screens may dramatically improve UX. E.g. when you open a restaurant menu cart, server may send fully detailed items. So you don't need additional requests when opening specific items from the menu.
    Colton Idle

    Colton Idle

    1 year ago
    Just hoist that object to another scope. I.e. if you have object in fragment a and want that object in fragment b, just put the object in the next scope up. Like the activity or navigation view model scope.
    Arkadii Ivanov

    Arkadii Ivanov

    1 year ago
    And then you open a heavy app like camera and your app is killed.
    Colton Idle

    Colton Idle

    1 year ago
    Parcelables are land mines. The binder transaction limit shrinks in every release.
    Arkadii Ivanov

    Arkadii Ivanov

    1 year ago
    Yes, it is still fine to pass a few thouand bytes. Anyway, glad there will always be ways to use parcelable.
    Even with compose-navigation, we can always encode a parcelable into a string)))
    i

    Ian Lake

    1 year ago
    Please don't
    Arkadii Ivanov

    Arkadii Ivanov

    1 year ago
    It's a joke)