TF-4050 refactor: move attachment preview & download logic to download controller

This commit is contained in:
dab246
2025-10-23 12:14:39 +07:00
committed by Dat H. Pham
parent 1398a30ed6
commit 92286b48e1
33 changed files with 1055 additions and 651 deletions
@@ -1,3 +1,6 @@
import 'package:core/presentation/state/failure.dart';
import 'package:core/presentation/state/success.dart';
import 'package:dartz/dartz.dart';
import 'package:jmap_dart_client/jmap/core/id.dart';
import 'package:model/email/attachment.dart';
import 'package:tmail_ui_user/features/base/action/ui_action.dart';
@@ -12,13 +15,13 @@ class DownloadUIAction extends UIAction {
}
class UpdateAttachmentsViewStateAction extends DownloadUIAction {
UpdateAttachmentsViewStateAction(this.blobId, this.success);
UpdateAttachmentsViewStateAction(this.blobId, this.viewState);
final Id? blobId;
final dynamic success;
final Either<Failure, Success> viewState;
@override
List<Object?> get props => [blobId, success];
List<Object?> get props => [blobId, viewState];
}
class DownloadAttachmentsQuicklyAction extends DownloadUIAction {
@@ -29,3 +32,12 @@ class DownloadAttachmentsQuicklyAction extends DownloadUIAction {
@override
List<Object?> get props => [attachment];
}
class OpenMailtoLinkFromPreviewAttachmentAction extends DownloadUIAction {
OpenMailtoLinkFromPreviewAttachmentAction(this.uri);
final Uri? uri;
@override
List<Object?> get props => [uri];
}