File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
composeApp/src/iosMain/kotlin/di Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff 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+
5961actual fun ByteArray.toComposeImageBitmap (): ImageBitmap {
6062 return Image .makeFromEncoded(this ).toComposeImageBitmap()
6163}
You can’t perform that action at this time.
0 commit comments