Hello!! When I press the button where I have the controller.capture function, I get the same error all the time, at first I thought I had something wrong configured, I cloned the repository to see the example, and I had it similar, but the example does not give me the same error as me
Capturable(
modifier = Modifier.constrainAs(ivLetterImage) {
linkTo(parent.start, parent.end)
linkTo(parent.top, tvAddressee.top)
width = Dimension.fillToConstraints
},
controller = controller,
onCaptured = { bitmap, error ->
//ticketBitmap = bitmap
error
context.share(
nameOfImage = letters,
message = "",
bitmap = bitmap?.asAndroidBitmap().orEmpty()
)
}
) {
LetterImage(
addressee = addressee.value.text,
message = message.value.text,
sender = sender.value.text,
letterImage = letterImage
)
}
@ExperimentalFoundationApi
@Composable
fun LetterImage(
modifier: Modifier = Modifier,
addressee: String,
message: String,
sender: String,
letterImage: String
) {
ConstraintLayout(
modifier = modifier
) {
val (
ivLetter,
tvAddressee,
tvMessage,
tvSender
) = createRefs()
NetworkImage(
modifier = Modifier
.wrapContentHeight()
.fillMaxWidth()
.constrainAs(ivLetter) {
linkTo(parent.start, parent.end)
linkTo(parent.top, parent.bottom)
},
contentScale = ContentScale.Crop,
url = letterImage,
builder = {
crossfade(true)
}
)
Text(
text = addressee,
maxLines = 1,
color = lightGreyPastel,
fontWeight = FontWeight.Bold,
style = TypographyNook.h6,
modifier = Modifier
.padding(top = 30.dp, start = 40.dp)
.constrainAs(tvAddressee) {
start.linkTo(parent.start)
top.linkTo(ivLetter.top)
}
)
Text(
text = message,
maxLines = 7,
color = lightGreyPastel,
fontWeight = FontWeight.Bold,
style = TypographyNook.h6,
modifier = Modifier
.padding(top = 20.dp, start = 60.dp, end = 60.dp)
.constrainAs(tvMessage) {
linkTo(parent.start, parent.end)
top.linkTo(tvAddressee.bottom)
bottom.linkTo(tvSender.top)
}
)
Text(
text = sender, //16,
maxLines = 1,
color = lightGreyPastel,
fontWeight = FontWeight.Bold,
style = TypographyNook.h6,
modifier = Modifier
.padding(top = 20.dp, bottom = 30.dp, end = 40.dp)
.constrainAs(tvSender) {
end.linkTo(parent.end)
linkTo(tvMessage.bottom, parent.bottom)
}
)
}
}