Hi All, I am currently facing the below issue with...
# compose
m
Hi All, I am currently facing the below issue with compose compiler version 1.2.0 and google decided not to fix it for now. One of the comments in there says setting the floatingActionButton to null would fix the issue. Can someone help me with how to set it to null? I have a lambda inside which I have an if condition based on which I want to show FloatingActionButton and in the other cases I want to set it to null. Thanks! https://issuetracker.google.com/issues/235588730
Copy code
floatingActionButton =
{
    if (!viewModel.isReadOnly()....) {
                FloatingActionButton(viewModel = viewModel, ...)
        }
}
a
Maybe set the
floatingActionButton
argument to null?
m
@Arkadii Ivanov Yeah, that is the proposed solution; however, I'm not sure how to do that. This did not work.
Copy code
floatingActionButton =
{
    if (!viewModel.isReadOnly()....) {
                FloatingActionButton(viewModel = viewModel, ...)
        } 
     else {
        null
        }
}
a
You can try to assign null to the argument itself. floatingActionButton = if (...) { {...} } else null