update README
This commit is contained in:
parent
c43961ba94
commit
96d756c8f0
40
README.md
40
README.md
@ -23,22 +23,11 @@ Add the following permissions to your *AndroidManifest.xml*, located in ```<proj
|
|||||||
|
|
||||||
```xml
|
```xml
|
||||||
<manifest ...>
|
<manifest ...>
|
||||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
<uses-permission
|
||||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
android:name="android.permission.READ_EXTERNAL_STORAGE"
|
||||||
...
|
android:maxSdkVersion="32" />
|
||||||
<manifest/>
|
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
|
||||||
```
|
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
|
||||||
|
|
||||||
API 29+
|
|
||||||
|
|
||||||
Add the following property to your *AndroidManifest.xml*, located in ```<project root>/android/app/src/main/AndroidManifest.xml``` to [opt-out of scoped storage](https://developer.android.com/training/data-storage/use-cases#opt-out-scoped-storage):
|
|
||||||
```xml
|
|
||||||
<manifest ...>
|
|
||||||
...
|
|
||||||
<application
|
|
||||||
android:requestLegacyExternalStorage="true"
|
|
||||||
...>
|
|
||||||
<application/>
|
|
||||||
<manifest/>
|
<manifest/>
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -46,22 +35,17 @@ Add the following property to your *AndroidManifest.xml*, located in ```<project
|
|||||||
|
|
||||||
* Listing albums in the gallery
|
* Listing albums in the gallery
|
||||||
```dart
|
```dart
|
||||||
final List<Album> imageAlbums = await PhotoGallery.listAlbums(
|
final List<Album> imageAlbums = await PhotoGallery.listAlbums();
|
||||||
mediumType: MediumType.image,
|
|
||||||
);
|
|
||||||
final List<Album> videoAlbums = await PhotoGallery.listAlbums(
|
final List<Album> videoAlbums = await PhotoGallery.listAlbums(
|
||||||
mediumType: MediumType.video,
|
mediumType: MediumType.video,
|
||||||
hideIfEmpty: false
|
newest: false,
|
||||||
|
hideIfEmpty: false,
|
||||||
);
|
);
|
||||||
```
|
```
|
||||||
* Listing media in an album
|
* Listing media in an album
|
||||||
```dart
|
```dart
|
||||||
final MediaPage imagePage = await imageAlbum.listMedia(
|
final MediaPage imagePage = await imageAlbum.listMedia();
|
||||||
skip: 5,
|
final MediaPage videoPage = await imageAlbum.listMedia(
|
||||||
take: 10,
|
|
||||||
);
|
|
||||||
final MediaPage videoPage = await videoAlbum.listMedia(
|
|
||||||
newest: false,
|
|
||||||
skip: 5,
|
skip: 5,
|
||||||
take: 10,
|
take: 10,
|
||||||
);
|
);
|
||||||
@ -133,6 +117,8 @@ final List<int> data = await album.getThumbnail(
|
|||||||
```dart
|
```dart
|
||||||
final List<int> data = await PhotoGallery.getAlbumThumbnail(
|
final List<int> data = await PhotoGallery.getAlbumThumbnail(
|
||||||
albumId: albumId,
|
albumId: albumId,
|
||||||
|
mediumType: MediumType.image,
|
||||||
|
newest: false,
|
||||||
width: 128,
|
width: 128,
|
||||||
height: 128,
|
height: 128,
|
||||||
highQuality: true,
|
highQuality: true,
|
||||||
@ -164,7 +150,7 @@ FadeInImage(
|
|||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
placeholder: MemoryImage(kTransparentImage),
|
placeholder: MemoryImage(kTransparentImage),
|
||||||
image: AlbumThumbnailProvider(
|
image: AlbumThumbnailProvider(
|
||||||
albumId: albumId,
|
album: album,
|
||||||
width: 128,
|
width: 128,
|
||||||
height: 128,
|
height: 128,
|
||||||
hightQuality: true,
|
hightQuality: true,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user