add some comments on public APIs

This commit is contained in:
Wenqi Li 2020-08-22 17:02:16 +08:00
parent 1fcc2d8663
commit 67ca4415a9

View File

@ -21,8 +21,7 @@ part 'src/models/medium.dart';
class PhotoGallery { class PhotoGallery {
static const MethodChannel _channel = const MethodChannel('photo_gallery'); static const MethodChannel _channel = const MethodChannel('photo_gallery');
/// List all available photo gallery albums and counts number of /// List all available gallery albums and counts number of items of [MediumType].
/// items of [MediumType].
static Future<List<Album>> listAlbums({ static Future<List<Album>> listAlbums({
@required MediumType mediumType, @required MediumType mediumType,
}) async { }) async {
@ -33,6 +32,7 @@ class PhotoGallery {
return json.map<Album>((x) => Album.fromJson(x)).toList(); return json.map<Album>((x) => Album.fromJson(x)).toList();
} }
/// List all available media in a specific album, support pagination of media
static Future<MediaPage> _listMedia({ static Future<MediaPage> _listMedia({
@required Album album, @required Album album,
@required int total, @required int total,
@ -50,6 +50,7 @@ class PhotoGallery {
return MediaPage.fromJson(album, json); return MediaPage.fromJson(album, json);
} }
/// Get medium metadata by medium id
static Future<Medium> getMedium({ static Future<Medium> getMedium({
@required String mediumId, @required String mediumId,
MediumType mediumType, MediumType mediumType,
@ -62,6 +63,7 @@ class PhotoGallery {
return Medium.fromJson(json); return Medium.fromJson(json);
} }
/// Get medium thumbnail by medium id
static Future<List<dynamic>> getThumbnail({ static Future<List<dynamic>> getThumbnail({
@required String mediumId, @required String mediumId,
MediumType mediumType, MediumType mediumType,
@ -80,6 +82,7 @@ class PhotoGallery {
return bytes; return bytes;
} }
/// Get album thumbnail by album id
static Future<List<dynamic>> getAlbumThumbnail({ static Future<List<dynamic>> getAlbumThumbnail({
@required String albumId, @required String albumId,
int width, int width,
@ -96,6 +99,7 @@ class PhotoGallery {
return bytes; return bytes;
} }
/// get medium file by medium id
static Future<File> getFile({ static Future<File> getFile({
@required String mediumId, @required String mediumId,
MediumType mediumType, MediumType mediumType,