From 84cad566dbc9566be261974d1593557b4c4ecf70 Mon Sep 17 00:00:00 2001 From: Wenqi Li Date: Sun, 30 Jul 2023 00:54:28 +0800 Subject: [PATCH] add public APIs' dartdoc comments --- lib/photo_gallery.dart | 1 + lib/src/common/medium_type.dart | 5 +++++ lib/src/image_providers/album_thumbnail_provider.dart | 8 ++++++++ lib/src/image_providers/photo_provider.dart | 4 ++++ lib/src/image_providers/thumbnail_provider.dart | 10 ++++++++++ lib/src/models/media_page.dart | 2 ++ 6 files changed, 30 insertions(+) diff --git a/lib/photo_gallery.dart b/lib/photo_gallery.dart index b9590d6..af722c2 100644 --- a/lib/photo_gallery.dart +++ b/lib/photo_gallery.dart @@ -130,6 +130,7 @@ class PhotoGallery { }); } + /// Clean medium file cache static Future cleanCache() async { _channel.invokeMethod('cleanCache', {}); } diff --git a/lib/src/common/medium_type.dart b/lib/src/common/medium_type.dart index f78210c..ee9d317 100644 --- a/lib/src/common/medium_type.dart +++ b/lib/src/common/medium_type.dart @@ -2,10 +2,14 @@ part of photogallery; /// A medium type. enum MediumType { + /// MediumType.image image, + + /// MediumType.video video, } +/// Convert MediumType to String String? mediumTypeToJson(MediumType? value) { switch (value) { case MediumType.image: @@ -17,6 +21,7 @@ String? mediumTypeToJson(MediumType? value) { } } +/// Parse String to MediumType MediumType? jsonToMediumType(String? value) { switch (value) { case 'image': diff --git a/lib/src/image_providers/album_thumbnail_provider.dart b/lib/src/image_providers/album_thumbnail_provider.dart index 5647d28..78f1a97 100644 --- a/lib/src/image_providers/album_thumbnail_provider.dart +++ b/lib/src/image_providers/album_thumbnail_provider.dart @@ -2,6 +2,7 @@ part of photogallery; /// Fetches the given album thumbnail from the gallery. class AlbumThumbnailProvider extends ImageProvider { + /// ImageProvider of album thumbnail const AlbumThumbnailProvider({ required this.album, this.height, @@ -9,9 +10,16 @@ class AlbumThumbnailProvider extends ImageProvider { this.highQuality = false, }); + /// Album info final Album album; + + /// Height of album thumbnail final int? height; + + /// Width of album thumbnail final int? width; + + /// Whether using high quality of album thumbnail final bool? highQuality; @override diff --git a/lib/src/image_providers/photo_provider.dart b/lib/src/image_providers/photo_provider.dart index a3a2c01..039cb21 100644 --- a/lib/src/image_providers/photo_provider.dart +++ b/lib/src/image_providers/photo_provider.dart @@ -2,12 +2,16 @@ part of photogallery; /// Fetches the given image from the gallery. class PhotoProvider extends ImageProvider { + /// ImageProvider of photo PhotoProvider({ required this.mediumId, this.mimeType, }); + /// Medium id final String mediumId; + + /// Mime type final String? mimeType; @override diff --git a/lib/src/image_providers/thumbnail_provider.dart b/lib/src/image_providers/thumbnail_provider.dart index c2e1424..6dc511a 100644 --- a/lib/src/image_providers/thumbnail_provider.dart +++ b/lib/src/image_providers/thumbnail_provider.dart @@ -2,6 +2,7 @@ part of photogallery; /// Fetches the given medium thumbnail from the gallery. class ThumbnailProvider extends ImageProvider { + /// ImageProvider of medium thumbnail const ThumbnailProvider({ required this.mediumId, this.mediumType, @@ -10,10 +11,19 @@ class ThumbnailProvider extends ImageProvider { this.highQuality = false, }); + /// Medium id final String mediumId; + + /// Medium type final MediumType? mediumType; + + /// Height of medium thumbnail final int? height; + + /// Width of medium thumbnail final int? width; + + /// Whether using high quality of medium thumbnail final bool? highQuality; @override diff --git a/lib/src/models/media_page.dart b/lib/src/models/media_page.dart index af6c39b..70ccfbf 100644 --- a/lib/src/models/media_page.dart +++ b/lib/src/models/media_page.dart @@ -3,6 +3,7 @@ part of photogallery; /// A list of media with pagination support. @immutable class MediaPage { + /// The album that belongs to final Album album; /// The start offset for those media. @@ -11,6 +12,7 @@ class MediaPage { /// The current items. final List items; + /// Whether using light weight option final bool? lightWeight; /// The end index in the album.