getAssetPathList method

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

Implementation

Future<List<AssetPathEntity>> getAssetPathList({
  bool hasAll = true,
  bool onlyAll = false,
  RequestType type = RequestType.common,
  PMFilter? filterOption,
  required PMPathFilter pathFilterOption,
}) async {
  if (onlyAll) {
    assert(hasAll, 'If only is true, then the hasAll must be not null.');
  }
  filterOption ??= FilterOptionGroup();
  final result = await _channel.invokeMethod<Map>(
    PMConstants.mGetAssetPathList,
    <String, dynamic>{
      'type': type.value,
      'hasAll': hasAll,
      'onlyAll': onlyAll,
      'option': filterOption.toMap(),
      'pathOption': pathFilterOption.toMap(),
    },
  );
  if (result == null) {
    return <AssetPathEntity>[];
  }
  return ConvertUtils.convertToPathList(
    result.cast(),
    type: type,
    filterOption: filterOption,
  );
}