TF-3450 Refactor image and text preview
This commit is contained in:
@@ -12,11 +12,12 @@ class StartDownloadAttachmentForWeb extends UIState {
|
||||
final DownloadTaskId taskId;
|
||||
final Attachment attachment;
|
||||
final CancelToken? cancelToken;
|
||||
final bool previewerSupported;
|
||||
|
||||
StartDownloadAttachmentForWeb(this.taskId, this.attachment, [this.cancelToken]);
|
||||
StartDownloadAttachmentForWeb(this.taskId, this.attachment, [this.cancelToken, this.previewerSupported = false]);
|
||||
|
||||
@override
|
||||
List<Object?> get props => [taskId, attachment, cancelToken];
|
||||
List<Object?> get props => [taskId, attachment, cancelToken, previewerSupported];
|
||||
}
|
||||
|
||||
class DownloadingAttachmentForWeb extends UIState {
|
||||
@@ -50,11 +51,12 @@ class DownloadAttachmentForWebSuccess extends UIState {
|
||||
final DownloadTaskId taskId;
|
||||
final Attachment attachment;
|
||||
final Uint8List bytes;
|
||||
final bool previewerSupported;
|
||||
|
||||
DownloadAttachmentForWebSuccess(this.taskId, this.attachment, this.bytes);
|
||||
DownloadAttachmentForWebSuccess(this.taskId, this.attachment, this.bytes, this.previewerSupported);
|
||||
|
||||
@override
|
||||
List<Object> get props => [taskId, attachment, bytes];
|
||||
List<Object> get props => [taskId, attachment, bytes, previewerSupported];
|
||||
}
|
||||
|
||||
class DownloadAttachmentForWebFailure extends FeatureFailure {
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:core/presentation/state/failure.dart';
|
||||
import 'package:core/presentation/state/success.dart';
|
||||
import 'package:model/email/attachment.dart';
|
||||
|
||||
class GettingImageDataFromAttachment extends LoadingState {
|
||||
GettingImageDataFromAttachment({required this.attachment});
|
||||
|
||||
final Attachment attachment;
|
||||
|
||||
@override
|
||||
List<Object> get props => [attachment];
|
||||
}
|
||||
|
||||
class GetImageDataFromAttachmentSuccess extends UIState {
|
||||
GetImageDataFromAttachmentSuccess({
|
||||
required this.attachment,
|
||||
required this.data,
|
||||
});
|
||||
|
||||
final Attachment attachment;
|
||||
final Uint8List data;
|
||||
|
||||
@override
|
||||
List<Object> get props => [attachment, data];
|
||||
}
|
||||
|
||||
class GetImageDataFromAttachmentFailure extends FeatureFailure {
|
||||
GetImageDataFromAttachmentFailure({super.exception});
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:core/presentation/state/failure.dart';
|
||||
import 'package:core/presentation/state/success.dart';
|
||||
import 'package:model/email/attachment.dart';
|
||||
|
||||
class GettingTextDataFromAttachment extends LoadingState {
|
||||
GettingTextDataFromAttachment({required this.attachment});
|
||||
|
||||
final Attachment attachment;
|
||||
|
||||
@override
|
||||
List<Object> get props => [attachment];
|
||||
}
|
||||
|
||||
class GetTextDataFromAttachmentSuccess extends UIState {
|
||||
GetTextDataFromAttachmentSuccess({
|
||||
required this.attachment,
|
||||
required this.data,
|
||||
});
|
||||
|
||||
final Attachment attachment;
|
||||
final Uint8List data;
|
||||
|
||||
@override
|
||||
List<Object> get props => [attachment, data];
|
||||
}
|
||||
|
||||
class GetTextDataFromAttachmentFailure extends FeatureFailure {
|
||||
GetTextDataFromAttachmentFailure({super.exception});
|
||||
}
|
||||
Reference in New Issue
Block a user