UiText

sealed class UiText

Represents text that can be either a string resource (localized) or a dynamic string (runtime).

This sealed class ensures type-safe handling of text throughout the application, particularly useful for passing text from business logic to UI without requiring Android Context.

See also

For runtime-generated strings

For localized string resources

Inheritors

Types

Link copied to clipboard
data class DynamicString(val value: String) : UiText

Represents a dynamic string generated at runtime.

Link copied to clipboard
class StringResource(@StringRes val resId: Int, val args: Any) : UiText

Represents a localized string resource with optional formatting arguments.

Functions

Link copied to clipboard

Resolves this UiText to a String within a Composable context.

fun asString(context: Context): String

Resolves this UiText to a String using an Android Context.