TF-654 Update datasource/repository for download attachment on web
This commit is contained in:
@@ -1,18 +1,64 @@
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:core/core.dart';
|
||||
import 'package:model/model.dart';
|
||||
|
||||
class StartDownloadAttachmentForWeb extends UIState {
|
||||
|
||||
final DownloadTaskId taskId;
|
||||
final Attachment attachment;
|
||||
|
||||
StartDownloadAttachmentForWeb(this.taskId, this.attachment);
|
||||
|
||||
@override
|
||||
List<Object> get props => [taskId, attachment];
|
||||
}
|
||||
|
||||
class DownloadingAttachmentForWeb extends UIState {
|
||||
|
||||
final DownloadTaskId taskId;
|
||||
final Attachment attachment;
|
||||
final double progress;
|
||||
final int downloaded;
|
||||
final int total;
|
||||
|
||||
DownloadingAttachmentForWeb(
|
||||
this.taskId,
|
||||
this.attachment,
|
||||
this.progress,
|
||||
this.downloaded,
|
||||
this.total
|
||||
);
|
||||
|
||||
@override
|
||||
List<Object> get props => [
|
||||
taskId,
|
||||
attachment,
|
||||
progress,
|
||||
downloaded,
|
||||
total
|
||||
];
|
||||
}
|
||||
|
||||
class DownloadAttachmentForWebSuccess extends UIState {
|
||||
|
||||
DownloadAttachmentForWebSuccess();
|
||||
final DownloadTaskId taskId;
|
||||
final Attachment attachment;
|
||||
final Uint8List bytes;
|
||||
|
||||
DownloadAttachmentForWebSuccess(this.taskId, this.attachment, this.bytes);
|
||||
|
||||
@override
|
||||
List<Object> get props => [];
|
||||
List<Object> get props => [taskId, attachment, bytes];
|
||||
}
|
||||
|
||||
class DownloadAttachmentForWebFailure extends FeatureFailure {
|
||||
|
||||
final DownloadTaskId taskId;
|
||||
final dynamic exception;
|
||||
|
||||
DownloadAttachmentForWebFailure(this.exception);
|
||||
DownloadAttachmentForWebFailure(this.taskId, this.exception);
|
||||
|
||||
@override
|
||||
List<Object> get props => [exception];
|
||||
List<Object> get props => [taskId, exception];
|
||||
}
|
||||
Reference in New Issue
Block a user