Skip to content

Commit f8acff1

Browse files
authored
Update README.md
1 parent 03b7e4b commit f8acff1

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ allprojects {
2020
}
2121

2222
dependencies {
23-
implementation 'com.github.ShaQib07:MediaPicker:latest-release'
23+
implementation 'com.github.ShaQib07:MediaPicker:latest_release'
2424
}
2525
```
2626
## Usage
@@ -51,6 +51,20 @@ Add necessary dependencies to use StateFlow in your app.
5151
}
5252
}
5353
```
54+
You may need to import the below dependency in order to use the `repeatOnLifecycle(Lifecycle.State.STARTED)` part.
55+
```bash
56+
implementation "androidx.lifecycle:lifecycle-runtime-ktx:latest_release"
57+
```
58+
If you'd like to upload the Media files through REST API and want them as MultipartBody.Part then you can the extension function `asMultipart()` like below.
59+
```bash
60+
lifecycleScope.launch {
61+
repeatOnLifecycle(Lifecycle.State.STARTED) {
62+
mediaPicker.pickedMedia.collectLatest { list ->
63+
val multipartList = list.asMultipart()
64+
}
65+
}
66+
}
67+
```
5468
5569
This is how the Image class looks like.
5670
```bash

0 commit comments

Comments
 (0)