Skip to content

Commit 59d73bc

Browse files
committed
ios add
1 parent 7f455d7 commit 59d73bc

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

composeApp/src/iosMain/kotlin/di/Platform.ios.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,19 @@ actual class AppCoroutineDispatchersImpl actual constructor() : AppCoroutineDisp
4545
}
4646

4747
@Composable
48-
actual fun ImagePicker(showFilePicker: Boolean, onResult: (ByteArray?) -> Unit) {
48+
actual fun ImagePicker(showFilePicker: Boolean,onDismissDialog : () -> Unit, onResult: (ByteArray?) -> Unit) {
4949
val scope = rememberCoroutineScope()
50-
val fileType = listOf("jpg", "png")
50+
val fileType = listOf("jpg", "jpeg","png")
5151
FilePicker(show = showFilePicker, fileExtensions = fileType) { file ->
5252
scope.launch {
5353
file?.getFileByteArray()?.let { onResult(it) }
5454
}
55+
onDismissDialog()
5556

5657
}
5758
}
5859

60+
5961
actual fun ByteArray.toComposeImageBitmap(): ImageBitmap {
6062
return Image.makeFromEncoded(this).toComposeImageBitmap()
6163
}

0 commit comments

Comments
 (0)