withLink
inline fun <R : Any> OudsAnnotatedString.LinkBuilder.withLink(link: OudsLinkAnnotation, block: OudsAnnotatedString.LinkBuilder.() -> R): R
DSL helper for applying link formatting to a block of text.
This is the recommended way to add links as it automatically manages the annotation stack.
Example:
buildOudsAnnotatedAlertMessageDescription {
append("Please read the ")
withLink(OudsLinkAnnotation.Url("https://example.com/terms")) {
append("terms and conditions")
}
append(" carefully")
}Content copied to clipboard
Return
The result of the block.
Parameters
link
The link annotation (URL or clickable).
block
The lambda that appends the text to be formatted as a link.