I need to implement visual transformation in Text but somehow Text doesn’t have this parameter only TextFiled does have this parameter. How to find solution about this?
Example;
TextField(
visualTransformation = // have this parameter
)
Text(
visualTransformation = // doesnt have this parameter
)
I need that because i have to show big decimal contains comma and dot seperator and i have visual transformation of this.
>Solution :
You can use your custom VisualTransformation class to transform your text before passing it to Text.
val visualTransformation = remember { CustomVisualTransformation() }
val transformedText = remember(value) {
visualTransformation.filter(AnnotatedString(value))
}.text
Text(text = transformedText)