Skip to content

Instantly share code, notes, and snippets.

@skydoves
Created March 28, 2026 01:14
Show Gist options
  • Select an option

  • Save skydoves/983c1f5f884dfb76818ddf76923b8940 to your computer and use it in GitHub Desktop.

Select an option

Save skydoves/983c1f5f884dfb76818ddf76923b8940 to your computer and use it in GitHub Desktop.
PlaceholderPlugin.Failure implementation
public data class Failure(val source: Any?) :
PlaceholderPlugin(),
ImagePlugin.FailureStatePlugin {
@Composable
override fun compose(
modifier: Modifier,
imageOptions: ImageOptions,
reason: Throwable?,
): ImagePlugin = apply {
if (source != null) {
ImageBySource(
source = source,
modifier = modifier,
alignment = imageOptions.alignment,
contentDescription = imageOptions.contentDescription,
contentScale = imageOptions.contentScale,
colorFilter = imageOptions.colorFilter,
alpha = imageOptions.alpha,
)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment