TF-675 Implement upload attachment on presentation layer
This commit is contained in:
@@ -3,11 +3,8 @@ import 'package:core/core.dart';
|
||||
import 'package:device_info_plus/device_info_plus.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:tmail_ui_user/features/base/base_bindings.dart';
|
||||
import 'package:tmail_ui_user/features/composer/data/datasource/composer_datasource.dart';
|
||||
import 'package:tmail_ui_user/features/composer/data/datasource/contact_datasource.dart';
|
||||
import 'package:tmail_ui_user/features/composer/data/datasource_impl/composer_datasource_impl.dart';
|
||||
import 'package:tmail_ui_user/features/composer/data/datasource_impl/contact_datasource_impl.dart';
|
||||
import 'package:tmail_ui_user/features/composer/data/network/composer_api.dart';
|
||||
import 'package:tmail_ui_user/features/composer/data/repository/auto_complete_repository_impl.dart';
|
||||
import 'package:tmail_ui_user/features/composer/data/repository/composer_repository_impl.dart';
|
||||
import 'package:tmail_ui_user/features/composer/data/repository/contact_repository_impl.dart';
|
||||
@@ -21,7 +18,6 @@ import 'package:tmail_ui_user/features/composer/domain/usecases/update_email_dra
|
||||
import 'package:tmail_ui_user/features/composer/domain/usecases/upload_attachment_interactor.dart';
|
||||
import 'package:tmail_ui_user/features/composer/domain/usecases/get_autocomplete_interactor.dart';
|
||||
import 'package:tmail_ui_user/features/composer/domain/usecases/send_email_interactor.dart';
|
||||
import 'package:tmail_ui_user/features/composer/domain/usecases/upload_mutiple_attachment_interactor.dart';
|
||||
import 'package:tmail_ui_user/features/composer/presentation/composer_controller.dart';
|
||||
import 'package:tmail_ui_user/features/composer/presentation/extensions/session_extension.dart';
|
||||
import 'package:tmail_ui_user/features/email/data/datasource/email_datasource.dart';
|
||||
@@ -41,9 +37,13 @@ import 'package:tmail_ui_user/features/manage_account/data/network/manage_accoun
|
||||
import 'package:tmail_ui_user/features/manage_account/data/repository/manage_account_repository_impl.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/domain/repository/manage_account_repository.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/domain/usecases/get_all_identities_interactor.dart';
|
||||
import 'package:tmail_ui_user/features/upload/data/datasource/attachment_upload_datasource.dart';
|
||||
import 'package:tmail_ui_user/features/upload/data/datasource_impl/attachment_upload_datasource_impl.dart';
|
||||
import 'package:tmail_ui_user/features/upload/data/network/file_uploader.dart';
|
||||
import 'package:tmail_ui_user/features/upload/domain/usecases/local_file_picker_interactor.dart';
|
||||
import 'package:uuid/uuid.dart';
|
||||
import 'package:tmail_ui_user/features/upload/presentation/controller/upload_controller.dart';
|
||||
import 'package:jmap_dart_client/http/http_client.dart' as jmap_http_client;
|
||||
import 'package:worker_manager/worker_manager.dart';
|
||||
|
||||
class ComposerBindings extends BaseBindings {
|
||||
|
||||
@@ -57,7 +57,7 @@ class ComposerBindings extends BaseBindings {
|
||||
}
|
||||
|
||||
void _bindingsUtils() {
|
||||
Get.lazyPut(() => const Uuid());
|
||||
Get.lazyPut(() => FileUploader(Get.find<DioClient>(), Get.find<Executor>()));
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -68,7 +68,7 @@ class ComposerBindings extends BaseBindings {
|
||||
dataSources.add(Get.find<TMailContactDataSourceImpl>());
|
||||
}
|
||||
|
||||
Get.lazyPut(() => ComposerDataSourceImpl(Get.find<ComposerAPI>()));
|
||||
Get.lazyPut(() => AttachmentUploadDataSourceImpl(Get.find<FileUploader>()));
|
||||
Get.lazyPut(() => ContactDataSourceImpl());
|
||||
Get.lazyPut(() => EmailDataSourceImpl(Get.find<EmailAPI>()));
|
||||
Get.lazyPut(() => HtmlDataSourceImpl(
|
||||
@@ -82,7 +82,7 @@ class ComposerBindings extends BaseBindings {
|
||||
|
||||
@override
|
||||
void bindingsDataSource() {
|
||||
Get.lazyPut<ComposerDataSource>(() => Get.find<ComposerDataSourceImpl>());
|
||||
Get.lazyPut<AttachmentUploadDataSource>(() => Get.find<AttachmentUploadDataSourceImpl>());
|
||||
Get.lazyPut<ContactDataSource>(() => Get.find<ContactDataSourceImpl>());
|
||||
Get.lazyPut<EmailDataSource>(() => Get.find<EmailDataSourceImpl>());
|
||||
Get.lazyPut<HtmlDataSource>(() => Get.find<HtmlDataSourceImpl>());
|
||||
@@ -91,7 +91,7 @@ class ComposerBindings extends BaseBindings {
|
||||
|
||||
@override
|
||||
void bindingsRepositoryImpl() {
|
||||
Get.lazyPut(() => ComposerRepositoryImpl(Get.find<ComposerDataSource>()));
|
||||
Get.lazyPut(() => ComposerRepositoryImpl(Get.find<AttachmentUploadDataSource>()));
|
||||
Get.lazyPut(() => AutoCompleteRepositoryImpl(dataSources));
|
||||
Get.lazyPut(() => ContactRepositoryImpl(Get.find<ContactDataSource>()));
|
||||
Get.lazyPut(() => EmailRepositoryImpl(
|
||||
@@ -120,7 +120,6 @@ class ComposerBindings extends BaseBindings {
|
||||
));
|
||||
Get.lazyPut(() => LocalFilePickerInteractor());
|
||||
Get.lazyPut(() => UploadAttachmentInteractor(Get.find<ComposerRepository>()));
|
||||
Get.lazyPut(() => UploadMultipleAttachmentInteractor(Get.find<UploadAttachmentInteractor>()));
|
||||
Get.lazyPut(() => SendEmailInteractor(Get.find<EmailRepository>()));
|
||||
Get.lazyPut(() => SaveEmailAsDraftsInteractor(Get.find<EmailRepository>()));
|
||||
Get.lazyPut(() => GetEmailContentInteractor(Get.find<EmailRepository>()));
|
||||
@@ -130,18 +129,23 @@ class ComposerBindings extends BaseBindings {
|
||||
|
||||
@override
|
||||
void bindingsController() {
|
||||
Get.lazyPut(() => UploadController(Get.find<UploadAttachmentInteractor>()));
|
||||
Get.lazyPut(() => ComposerController(
|
||||
Get.find<SendEmailInteractor>(),
|
||||
Get.find<GetAutoCompleteInteractor>(),
|
||||
Get.find<GetAutoCompleteWithDeviceContactInteractor>(),
|
||||
Get.find<Uuid>(),
|
||||
Get.find<DeviceInfoPlugin>(),
|
||||
Get.find<LocalFilePickerInteractor>(),
|
||||
Get.find<UploadMultipleAttachmentInteractor>(),
|
||||
Get.find<SaveEmailAsDraftsInteractor>(),
|
||||
Get.find<GetEmailContentInteractor>(),
|
||||
Get.find<UpdateEmailDraftsInteractor>(),
|
||||
Get.find<GetAllIdentitiesInteractor>(),
|
||||
Get.find<UploadController>(),
|
||||
));
|
||||
}
|
||||
|
||||
void dispose() {
|
||||
Get.delete<UploadController>();
|
||||
Get.delete<ComposerController>();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user