filekit-coil lets Coil 3 load a PlatformFile directly, so you can pass a picked file to AsyncImage as its model.
Usage
PlatformFile support once, in your root composable:
PlatformFile as the model:
ImageLoader instead of the singleton, call addPlatformFileSupport() in its components block.
Load files that need security-scoped access
Coil reads the file itself, without the security-scoped access FileKit starts around its own operations. CallsecurelyAccessFile from onState when the file comes from:
- the file or directory picker on iOS, which return files outside your app’s sandbox;
- a bookmark restored on iOS, or on macOS (native or JVM) when the app is sandboxed.
Related
- Image and video utilities to compress images or get an
ImageBitmap. - Gallery picker to let users pick photos.
- Coil documentation for transformations, placeholders, and caching.