nglauber
09/29/2023, 1:51 PMTopAppBarColors
. The constructor of this class and its fields are private
. The only way to create a TopAppBarColors
is via TopAppBarDefaults.topAppBarColors
function which all parameters are optional.
So, I just would like to pass the parameter if the value I have is not null.jw
09/29/2023, 1:53 PMnglauber
09/29/2023, 1:54 PMnglauber
09/29/2023, 1:54 PMTopAppBarDefaults.topAppBarColors
they are all private/internal ๐jw
09/29/2023, 1:54 PMval thing = if (yourThing != null) {
CreateTheThing(thing = yourThing)
} else {
CreateTheThing()
}
nglauber
09/29/2023, 1:55 PMnglauber
09/29/2023, 1:56 PMif a != null
CreateThing(a)
else if a != null && b != null
CreateThing(a, b)
else if a != null && b != null && c != null
CreateThing(a, b, c)
...
nglauber
09/29/2023, 1:57 PMjw
09/29/2023, 2:00 PMnglauber
09/29/2023, 2:03 PMTopAppBarColors
and get the values from this instance via reflection...nglauber
09/29/2023, 2:03 PMFIXME
for future reference ๐jw
09/29/2023, 2:04 PMInt
whose bits represent whether an argument value was passed by the caller or whether they're relying on the default. There's a synthetic method overload which accepts all arguments, plus the bit-packed int, plus a marker object that you could then call.nglauber
09/29/2023, 2:07 PM