Shoaib Kakal
Shoaib Kakal

Reputation: 1336

Error "Cannot find a parameter with this name: brush" in Jetpack Compose

I copied the below code from BrushExampleSnippet.kt but the compiler gives an error that it can't find brush, I double checked import but it's correct as import androidx.compose.ui.text.TextStyle.

    // Use ImageShader Brush with TextStyle
    Text(
        text = "Hello Android!",
        style = TextStyle(
            brush = imageBrush, // here brush parameter is not found.
            fontWeight = FontWeight.ExtraBold,
            fontSize = 36.sp
        )
    )

enter image description here

Upvotes: 0

Views: 619

Answers (1)

Gabriele Mariotti
Gabriele Mariotti

Reputation: 363825

Brush API was added to TextStyle by compose 1.2.0.

Upvotes: 1

Related Questions