What this message means 'Modifier factory functions must use the receiver Modifier instance' When writing a modifier like fun Modifier.myModifier(i:Int):Modifier{ return Modifier.border(BorderStroke(1.dp,Color.Blue),RoundedCornerShape(6.dp))} It works as expected ...
z
Zach Klippenstein (he/him) [MOD]
08/02/2021, 3:21 PM
Probably means you have a function that returns a modifier, but you’re not chaining it to the incoming modifier (specified as the extension receiver). Might be missing a
then
m
MBegemot
08/02/2021, 3:23 PM
Thank you so much, but why then it works?
z
Zach Klippenstein (he/him) [MOD]
08/02/2021, 3:26 PM
Modifier chaining doesn’t happen by magic. Under the hood, it’s all: