listAlbums static method

Future<List<Album>> listAlbums({
  1. MediumType? mediumType,
  2. bool newest = true,
  3. bool hideIfEmpty = true,
})

List all available gallery albums and counts number of items of MediumType. mediumType: medium type of albums newest: whether to sort media by latest date in albums hideIfEmpty: whether to hide empty albums, only available on iOS

Implementation

static Future<List<Album>> listAlbums({
  MediumType? mediumType,
  bool newest = true,
  bool hideIfEmpty = true,
}) async {
  final json = await _channel.invokeMethod('listAlbums', {
    'mediumType': mediumTypeToJson(mediumType),
    'hideIfEmpty': hideIfEmpty,
  });
  return json.map<Album>((album) => Album.fromJson(album, mediumType, newest)).toList();
}