Ashu

    Ashu

    1 year ago
    The
    onSizeChanged
    modifier provides size values in
    IntSize
    , and the
    onSizeChanged
    lambda is not a composable function either. How can I get size in
    Dp
    inside
    onSizeChanged
    modifier lambda.??
    Dominaezzz

    Dominaezzz

    1 year ago
    I'm guessing you're having trouble accessing
    LocalDensity
    then?
    Ashu

    Ashu

    1 year ago
    Yep, since that requires composable scope
    Dominaezzz

    Dominaezzz

    1 year ago
    Read it in the composable function the consume in the lamdba. There are many ways to make this work.
    Ashu

    Ashu

    1 year ago
    Well yeah, I am making it work by keeping the 1dp to px mapping in the outside composable and using that to convert in
    onSizeChanged
    but I was hoping if there were a better way to do this.