getAssetPathList static method

Future<List<AssetPathEntity>> getAssetPathList({
  1. bool hasAll = true,
  2. bool onlyAll = false,
  3. RequestType type = RequestType.common,
  4. FilterOptionGroup? filterOption,
})

get gallery list

获取相册"文件夹" 列表

hasAll contains all path, such as "Camera Roll" on ios or "Recent" on android. hasAll 包含所有项目的相册

onlyAll If true, Return only one album with all resources. onlyAll 如果为真, 则只返回一个包含所有项目的相册

Implementation

static Future<List<AssetPathEntity>> getAssetPathList({
  bool hasAll = true,
  bool onlyAll = false,
  RequestType type = RequestType.common,
  FilterOptionGroup? filterOption,
}) async {
  if (onlyAll) {
    assert(hasAll, "If only is true, then the hasAll must be not null.");
  }
  filterOption ??= FilterOptionGroup();

  assert(
      type.index != 0, 'The request type must have video, image or audio.');

  if (type.index == 0) {
    return [];
  }

  return _plugin.getAllGalleryList(
    type: type.index,
    hasAll: hasAll,
    onlyAll: onlyAll,
    optionGroup: filterOption,
  );
}