onAddUpload method

Future<bool> onAddUpload(
  1. List<AssetEntity>? list
)

Implementation

Future<bool> onAddUpload(List<AssetEntity>? list) async {
  if (list != null) {
    for (var i = 0; i < list.length; i++) {
      if (modelList.length <= maxNum) {
        AssetEntity item = list[i];

        File? file = await item.file;

        if (file != null) {
          modelList.add(MXUploadImgItemModel(
              actionUrl: actionUrl,
              entity: item,
              file: file,
              hooks: hooks,
              type: UploadType.wait,
              uploadComplated: onUploadSingleComplated,
              progressNum: 0));
        }
      }
    }
  }

  return true;
}