I have a Stack widget which hosts a Box and an Image. As the state changes, I want to scale the Box widget by whatever value the state has, for example by 2x.
I couldn't find anything about scaling the widgets on the Modifier or Box properties so I decided to react to the state changes by manipulating the size using "Modifier.size" which is not ideal for me.
So is there support for scaling the widgets or should I manually play with the size property?
-Thanks
@Composable
fun Pointer(modifier: Modifier = Modifier, state: TransitionState, onClick: () -> Unit) {
Stack(modifier) {
Box(
shape = CircleShape, backgroundColor = Color.Gray.copy(alpha = .3f),
modifier = Modifier.size(state[width])
)
Image(
asset = imageResource(id = R.drawable.ic_pointer),
modifier = Modifier
.clickable(onClick = onClick)
)
}
}