TF-56 Implement upload single attachment
This commit is contained in:
@@ -1,5 +1,8 @@
|
|||||||
import 'package:jmap_dart_client/jmap/mail/email/email_address.dart';
|
import 'package:jmap_dart_client/jmap/mail/email/email_address.dart';
|
||||||
|
import 'package:model/model.dart';
|
||||||
|
|
||||||
abstract class ComposerDataSource {
|
abstract class ComposerDataSource {
|
||||||
Future<bool> saveEmailAddresses(List<EmailAddress> listEmailAddress);
|
Future<bool> saveEmailAddresses(List<EmailAddress> listEmailAddress);
|
||||||
|
|
||||||
|
Future<Attachment> uploadAttachment(UploadRequest uploadRequest);
|
||||||
}
|
}
|
||||||
@@ -1,12 +1,26 @@
|
|||||||
import 'package:jmap_dart_client/jmap/mail/email/email_address.dart';
|
import 'package:jmap_dart_client/jmap/mail/email/email_address.dart';
|
||||||
|
import 'package:model/model.dart';
|
||||||
import 'package:tmail_ui_user/features/composer/data/datasource/composer_datasource.dart';
|
import 'package:tmail_ui_user/features/composer/data/datasource/composer_datasource.dart';
|
||||||
|
import 'package:tmail_ui_user/features/composer/data/network/composer_api.dart';
|
||||||
|
|
||||||
class ComposerDataSourceImpl extends ComposerDataSource {
|
class ComposerDataSourceImpl extends ComposerDataSource {
|
||||||
|
|
||||||
ComposerDataSourceImpl();
|
final ComposerAPI _composerAPI;
|
||||||
|
|
||||||
|
ComposerDataSourceImpl(this._composerAPI);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<bool> saveEmailAddresses(List<EmailAddress> listEmailAddress) {
|
Future<bool> saveEmailAddresses(List<EmailAddress> listEmailAddress) {
|
||||||
throw UnimplementedError();
|
throw UnimplementedError();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<Attachment> uploadAttachment(UploadRequest uploadRequest) {
|
||||||
|
return Future.sync(() async {
|
||||||
|
final uploadResponse = await _composerAPI.uploadAttachment(uploadRequest);
|
||||||
|
return uploadResponse.toAttachmentFile(uploadRequest.fileInfo.fileName);
|
||||||
|
}).catchError((error) {
|
||||||
|
throw error;
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
import 'package:jmap_dart_client/jmap/mail/email/email_address.dart';
|
import 'package:jmap_dart_client/jmap/mail/email/email_address.dart';
|
||||||
|
import 'package:model/model.dart';
|
||||||
|
import 'package:model/upload/upload_request.dart';
|
||||||
import 'package:tmail_ui_user/features/composer/data/datasource/composer_datasource.dart';
|
import 'package:tmail_ui_user/features/composer/data/datasource/composer_datasource.dart';
|
||||||
import 'package:tmail_ui_user/features/composer/data/local/email_address_database_manager.dart';
|
import 'package:tmail_ui_user/features/composer/data/local/email_address_database_manager.dart';
|
||||||
|
|
||||||
@@ -16,4 +18,9 @@ class LocalComposerDataSourceImpl extends ComposerDataSource {
|
|||||||
throw error;
|
throw error;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<Attachment> uploadAttachment(UploadRequest uploadRequest) {
|
||||||
|
throw UnimplementedError();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
|
||||||
|
import 'dart:io';
|
||||||
|
|
||||||
|
import 'package:core/core.dart';
|
||||||
|
import 'package:dio/dio.dart';
|
||||||
|
import 'package:model/model.dart';
|
||||||
|
|
||||||
|
class ComposerAPI {
|
||||||
|
|
||||||
|
final DioClient _dioClient;
|
||||||
|
|
||||||
|
ComposerAPI(this._dioClient);
|
||||||
|
|
||||||
|
Future<UploadResponse> uploadAttachment(UploadRequest uploadRequest) async {
|
||||||
|
final resultJson = await _dioClient.post(
|
||||||
|
Uri.decodeFull(uploadRequest.uploadUrl.toString()),
|
||||||
|
options: Options(headers: _buildHeaderRequestParam(uploadRequest.accountRequest.basicAuth())),
|
||||||
|
data: File(uploadRequest.fileInfo.filePath).readAsBytesSync());
|
||||||
|
return UploadResponse.fromJson(resultJson);
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> _buildHeaderRequestParam(String basicAuth) {
|
||||||
|
final headerParam = _dioClient.getHeaders();
|
||||||
|
headerParam[HttpHeaders.authorizationHeader] = basicAuth;
|
||||||
|
headerParam[HttpHeaders.acceptHeader] = DioClient.jmapHeader;
|
||||||
|
return headerParam;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
|
|
||||||
import 'package:core/core.dart';
|
import 'package:core/core.dart';
|
||||||
import 'package:jmap_dart_client/jmap/mail/email/email_address.dart';
|
import 'package:jmap_dart_client/jmap/mail/email/email_address.dart';
|
||||||
|
import 'package:model/model.dart';
|
||||||
|
import 'package:model/upload/upload_request.dart';
|
||||||
import 'package:tmail_ui_user/features/composer/data/datasource/composer_datasource.dart';
|
import 'package:tmail_ui_user/features/composer/data/datasource/composer_datasource.dart';
|
||||||
import 'package:tmail_ui_user/features/composer/domain/repository/composer_repository.dart';
|
import 'package:tmail_ui_user/features/composer/domain/repository/composer_repository.dart';
|
||||||
|
|
||||||
@@ -14,4 +16,9 @@ class ComposerRepositoryImpl extends ComposerRepository {
|
|||||||
Future<bool> saveEmailAddresses(List<EmailAddress> listEmailAddress) {
|
Future<bool> saveEmailAddresses(List<EmailAddress> listEmailAddress) {
|
||||||
return composerDataSources[DataSourceType.local]!.saveEmailAddresses(listEmailAddress);
|
return composerDataSources[DataSourceType.local]!.saveEmailAddresses(listEmailAddress);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<Attachment> uploadAttachment(UploadRequest uploadRequest) {
|
||||||
|
return composerDataSources[DataSourceType.network]!.uploadAttachment(uploadRequest);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,8 @@
|
|||||||
import 'package:jmap_dart_client/jmap/mail/email/email_address.dart';
|
import 'package:jmap_dart_client/jmap/mail/email/email_address.dart';
|
||||||
|
import 'package:model/model.dart';
|
||||||
|
|
||||||
abstract class ComposerRepository {
|
abstract class ComposerRepository {
|
||||||
Future<bool> saveEmailAddresses(List<EmailAddress> listEmailAddress);
|
Future<bool> saveEmailAddresses(List<EmailAddress> listEmailAddress);
|
||||||
|
|
||||||
|
Future<Attachment> uploadAttachment(UploadRequest uploadRequest);
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
import 'package:core/core.dart';
|
||||||
|
import 'package:model/model.dart';
|
||||||
|
|
||||||
|
class UploadAttachmentLoadingState extends UIState {
|
||||||
|
UploadAttachmentLoadingState();
|
||||||
|
|
||||||
|
@override
|
||||||
|
List<Object?> get props => [];
|
||||||
|
}
|
||||||
|
|
||||||
|
class UploadAttachmentSuccess extends UIState {
|
||||||
|
final Attachment attachment;
|
||||||
|
|
||||||
|
UploadAttachmentSuccess(this.attachment);
|
||||||
|
|
||||||
|
@override
|
||||||
|
List<Object?> get props => [attachment];
|
||||||
|
}
|
||||||
|
|
||||||
|
class UploadAttachmentFailure extends FeatureFailure {
|
||||||
|
final exception;
|
||||||
|
|
||||||
|
UploadAttachmentFailure(this.exception);
|
||||||
|
|
||||||
|
@override
|
||||||
|
List<Object> get props => [exception];
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
import 'package:core/core.dart';
|
||||||
|
import 'package:dartz/dartz.dart';
|
||||||
|
import 'package:jmap_dart_client/jmap/account_id.dart';
|
||||||
|
import 'package:model/model.dart';
|
||||||
|
import 'package:tmail_ui_user/features/composer/domain/repository/composer_repository.dart';
|
||||||
|
import 'package:tmail_ui_user/features/composer/domain/state/upload_attachment_state.dart';
|
||||||
|
import 'package:tmail_ui_user/features/login/domain/repository/credential_repository.dart';
|
||||||
|
|
||||||
|
class UploadAttachmentInteractor {
|
||||||
|
final ComposerRepository _composerRepository;
|
||||||
|
final CredentialRepository _credentialRepository;
|
||||||
|
|
||||||
|
UploadAttachmentInteractor(this._composerRepository, this._credentialRepository);
|
||||||
|
|
||||||
|
Stream<Either<Failure, Success>> execute(FileInfo fileInfo, AccountId accountId, Uri uploadUrl) async* {
|
||||||
|
try {
|
||||||
|
yield Right<Failure, Success>(UploadAttachmentLoadingState());
|
||||||
|
final result = await Future.wait(
|
||||||
|
[_credentialRepository.getUserName(), _credentialRepository.getPassword()],
|
||||||
|
eagerError: true
|
||||||
|
).then((List responses) async {
|
||||||
|
final accountRequest = AccountRequest(responses.first, responses.last);
|
||||||
|
return await _composerRepository.uploadAttachment(UploadRequest(uploadUrl, accountId, fileInfo, accountRequest));
|
||||||
|
});
|
||||||
|
yield Right<Failure, Success>(UploadAttachmentSuccess(result));
|
||||||
|
} catch (e) {
|
||||||
|
yield Left<Failure, Success>(UploadAttachmentFailure(e));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,6 +3,7 @@ import 'package:core/presentation/utils/app_toast.dart';
|
|||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:html_editor_enhanced/html_editor.dart';
|
import 'package:html_editor_enhanced/html_editor.dart';
|
||||||
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
import 'package:tmail_ui_user/features/composer/data/datasource/autocomplete_datasource.dart';
|
import 'package:tmail_ui_user/features/composer/data/datasource/autocomplete_datasource.dart';
|
||||||
import 'package:tmail_ui_user/features/composer/data/datasource/composer_datasource.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/contact_datasource.dart';
|
||||||
@@ -12,6 +13,7 @@ import 'package:tmail_ui_user/features/composer/data/datasource_impl/contact_dat
|
|||||||
import 'package:tmail_ui_user/features/composer/data/datasource_impl/local_autocomplete_datasource_impl.dart';
|
import 'package:tmail_ui_user/features/composer/data/datasource_impl/local_autocomplete_datasource_impl.dart';
|
||||||
import 'package:tmail_ui_user/features/composer/data/datasource_impl/local_composer_datasource_impl.dart';
|
import 'package:tmail_ui_user/features/composer/data/datasource_impl/local_composer_datasource_impl.dart';
|
||||||
import 'package:tmail_ui_user/features/composer/data/local/email_address_database_manager.dart';
|
import 'package:tmail_ui_user/features/composer/data/local/email_address_database_manager.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/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/composer_repository_impl.dart';
|
||||||
import 'package:tmail_ui_user/features/composer/data/repository/contact_repository_impl.dart';
|
import 'package:tmail_ui_user/features/composer/data/repository/contact_repository_impl.dart';
|
||||||
@@ -20,18 +22,22 @@ import 'package:tmail_ui_user/features/composer/domain/repository/composer_repos
|
|||||||
import 'package:tmail_ui_user/features/composer/domain/repository/contact_repository.dart';
|
import 'package:tmail_ui_user/features/composer/domain/repository/contact_repository.dart';
|
||||||
import 'package:tmail_ui_user/features/composer/domain/usecases/get_autocomplete_with_device_contact_interactor.dart';
|
import 'package:tmail_ui_user/features/composer/domain/usecases/get_autocomplete_with_device_contact_interactor.dart';
|
||||||
import 'package:tmail_ui_user/features/composer/domain/usecases/get_device_contact_suggestions_interactor.dart';
|
import 'package:tmail_ui_user/features/composer/domain/usecases/get_device_contact_suggestions_interactor.dart';
|
||||||
|
import 'package:tmail_ui_user/features/composer/domain/usecases/upload_attachment_interactor.dart';
|
||||||
import 'package:tmail_ui_user/features/composer/domain/usecases/save_email_addresses_interactor.dart';
|
import 'package:tmail_ui_user/features/composer/domain/usecases/save_email_addresses_interactor.dart';
|
||||||
import 'package:tmail_ui_user/features/composer/domain/usecases/get_autocomplete_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/send_email_interactor.dart';
|
||||||
import 'package:tmail_ui_user/features/composer/presentation/composer_controller.dart';
|
import 'package:tmail_ui_user/features/composer/presentation/composer_controller.dart';
|
||||||
import 'package:tmail_ui_user/features/email/domain/repository/email_repository.dart';
|
import 'package:tmail_ui_user/features/email/domain/repository/email_repository.dart';
|
||||||
|
import 'package:tmail_ui_user/features/login/data/repository/credential_repository_impl.dart';
|
||||||
|
import 'package:tmail_ui_user/features/login/domain/repository/credential_repository.dart';
|
||||||
|
import 'package:tmail_ui_user/features/upload/domain/usecases/local_file_picker_interactor.dart';
|
||||||
import 'package:uuid/uuid.dart';
|
import 'package:uuid/uuid.dart';
|
||||||
|
|
||||||
class ComposerBindings extends Bindings {
|
class ComposerBindings extends Bindings {
|
||||||
@override
|
@override
|
||||||
void dependencies() {
|
void dependencies() {
|
||||||
Get.lazyPut(() => EmailAddressDatabaseManager(Get.find<DatabaseClient>()));
|
Get.lazyPut(() => EmailAddressDatabaseManager(Get.find<DatabaseClient>()));
|
||||||
Get.lazyPut(() => ComposerDataSourceImpl());
|
Get.lazyPut(() => ComposerDataSourceImpl(Get.find<ComposerAPI>()));
|
||||||
Get.lazyPut(() => LocalComposerDataSourceImpl(Get.find<EmailAddressDatabaseManager>()));
|
Get.lazyPut(() => LocalComposerDataSourceImpl(Get.find<EmailAddressDatabaseManager>()));
|
||||||
Get.lazyPut<ComposerDataSource>(() => Get.find<ComposerDataSourceImpl>());
|
Get.lazyPut<ComposerDataSource>(() => Get.find<ComposerDataSourceImpl>());
|
||||||
Get.lazyPut(() => ComposerRepositoryImpl({
|
Get.lazyPut(() => ComposerRepositoryImpl({
|
||||||
@@ -61,6 +67,12 @@ class ComposerBindings extends Bindings {
|
|||||||
Get.lazyPut(() => GetAutoCompleteWithDeviceContactInteractor(
|
Get.lazyPut(() => GetAutoCompleteWithDeviceContactInteractor(
|
||||||
Get.find<GetAutoCompleteInteractor>(),
|
Get.find<GetAutoCompleteInteractor>(),
|
||||||
Get.find<GetDeviceContactSuggestionsInteractor>()));
|
Get.find<GetDeviceContactSuggestionsInteractor>()));
|
||||||
|
Get.lazyPut(() => LocalFilePickerInteractor());
|
||||||
|
Get.lazyPut(() => CredentialRepositoryImpl(Get.find<SharedPreferences>()));
|
||||||
|
Get.lazyPut<CredentialRepository>(() => Get.find<CredentialRepositoryImpl>());
|
||||||
|
Get.lazyPut(() => UploadAttachmentInteractor(
|
||||||
|
Get.find<ComposerRepository>(),
|
||||||
|
Get.find<CredentialRepository>()));
|
||||||
Get.lazyPut(() => ComposerController(
|
Get.lazyPut(() => ComposerController(
|
||||||
Get.find<SendEmailInteractor>(),
|
Get.find<SendEmailInteractor>(),
|
||||||
Get.find<SaveEmailAddressesInteractor>(),
|
Get.find<SaveEmailAddressesInteractor>(),
|
||||||
@@ -71,5 +83,8 @@ class ComposerBindings extends Bindings {
|
|||||||
Get.find<HtmlEditorController>(),
|
Get.find<HtmlEditorController>(),
|
||||||
Get.find<TextEditingController>(),
|
Get.find<TextEditingController>(),
|
||||||
Get.find<HtmlMessagePurifier>()));
|
Get.find<HtmlMessagePurifier>()));
|
||||||
|
Get.find<HtmlEditorController>(),
|
||||||
|
Get.find<LocalFilePickerInteractor>(),
|
||||||
|
Get.find<UploadAttachmentInteractor>()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4,6 +4,7 @@ import 'dart:async';
|
|||||||
import 'package:core/core.dart';
|
import 'package:core/core.dart';
|
||||||
import 'package:core/presentation/utils/app_toast.dart';
|
import 'package:core/presentation/utils/app_toast.dart';
|
||||||
import 'package:dartz/dartz.dart';
|
import 'package:dartz/dartz.dart';
|
||||||
|
import 'package:file_picker/file_picker.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:html_editor_enhanced/html_editor.dart';
|
import 'package:html_editor_enhanced/html_editor.dart';
|
||||||
@@ -23,6 +24,10 @@ import 'package:tmail_ui_user/features/composer/domain/model/email_request.dart'
|
|||||||
import 'package:tmail_ui_user/features/composer/domain/state/get_autocomplete_state.dart';
|
import 'package:tmail_ui_user/features/composer/domain/state/get_autocomplete_state.dart';
|
||||||
import 'package:tmail_ui_user/features/composer/domain/usecases/get_autocomplete_interactor.dart';
|
import 'package:tmail_ui_user/features/composer/domain/usecases/get_autocomplete_interactor.dart';
|
||||||
import 'package:tmail_ui_user/features/composer/domain/usecases/get_autocomplete_with_device_contact_interactor.dart';
|
import 'package:tmail_ui_user/features/composer/domain/usecases/get_autocomplete_with_device_contact_interactor.dart';
|
||||||
|
import 'package:tmail_ui_user/features/composer/domain/state/upload_attachment_state.dart';
|
||||||
|
import 'package:tmail_ui_user/features/composer/domain/state/search_email_address_state.dart';
|
||||||
|
import 'package:tmail_ui_user/features/composer/domain/state/send_email_state.dart';
|
||||||
|
import 'package:tmail_ui_user/features/composer/domain/usecases/upload_attachment_interactor.dart';
|
||||||
import 'package:tmail_ui_user/features/composer/domain/usecases/save_email_addresses_interactor.dart';
|
import 'package:tmail_ui_user/features/composer/domain/usecases/save_email_addresses_interactor.dart';
|
||||||
import 'package:tmail_ui_user/features/composer/domain/usecases/send_email_interactor.dart';
|
import 'package:tmail_ui_user/features/composer/domain/usecases/send_email_interactor.dart';
|
||||||
import 'package:tmail_ui_user/features/composer/presentation/extensions/email_action_type_extension.dart';
|
import 'package:tmail_ui_user/features/composer/presentation/extensions/email_action_type_extension.dart';
|
||||||
@@ -30,7 +35,10 @@ import 'package:tmail_ui_user/features/email/presentation/constants/email_consta
|
|||||||
import 'package:tmail_ui_user/features/email/presentation/extensions/email_content_extension.dart';
|
import 'package:tmail_ui_user/features/email/presentation/extensions/email_content_extension.dart';
|
||||||
import 'package:tmail_ui_user/features/email/presentation/model/composer_arguments.dart';
|
import 'package:tmail_ui_user/features/email/presentation/model/composer_arguments.dart';
|
||||||
import 'package:tmail_ui_user/features/email/presentation/model/message_content.dart';
|
import 'package:tmail_ui_user/features/email/presentation/model/message_content.dart';
|
||||||
|
import 'package:tmail_ui_user/features/upload/domain/state/local_file_picker_state.dart';
|
||||||
|
import 'package:tmail_ui_user/features/upload/domain/usecases/local_file_picker_interactor.dart';
|
||||||
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
||||||
|
import 'package:tmail_ui_user/main/routes/route_navigation.dart';
|
||||||
import 'package:uuid/uuid.dart';
|
import 'package:uuid/uuid.dart';
|
||||||
|
|
||||||
class ComposerController extends BaseController {
|
class ComposerController extends BaseController {
|
||||||
@@ -39,6 +47,7 @@ class ComposerController extends BaseController {
|
|||||||
final composerArguments = Rxn<ComposerArguments>();
|
final composerArguments = Rxn<ComposerArguments>();
|
||||||
final isEnableEmailSendButton = false.obs;
|
final isEnableEmailSendButton = false.obs;
|
||||||
final listReplyToEmailAddress = <EmailAddress>[].obs;
|
final listReplyToEmailAddress = <EmailAddress>[].obs;
|
||||||
|
final attachments = <Attachment>[].obs;
|
||||||
|
|
||||||
final SendEmailInteractor _sendEmailInteractor;
|
final SendEmailInteractor _sendEmailInteractor;
|
||||||
final SaveEmailAddressesInteractor _saveEmailAddressInteractor;
|
final SaveEmailAddressesInteractor _saveEmailAddressInteractor;
|
||||||
@@ -49,6 +58,9 @@ class ComposerController extends BaseController {
|
|||||||
final HtmlEditorController composerEditorController;
|
final HtmlEditorController composerEditorController;
|
||||||
final TextEditingController subjectEmailInputController;
|
final TextEditingController subjectEmailInputController;
|
||||||
final HtmlMessagePurifier _htmlMessagePurifier;
|
final HtmlMessagePurifier _htmlMessagePurifier;
|
||||||
|
final HtmlEditorController htmlEditorController;
|
||||||
|
final LocalFilePickerInteractor _localFilePickerInteractor;
|
||||||
|
final UploadAttachmentInteractor _uploadAttachmentInteractor;
|
||||||
|
|
||||||
List<EmailAddress> listToEmailAddress = [];
|
List<EmailAddress> listToEmailAddress = [];
|
||||||
List<EmailAddress> listCcEmailAddress = [];
|
List<EmailAddress> listCcEmailAddress = [];
|
||||||
@@ -68,6 +80,9 @@ class ComposerController extends BaseController {
|
|||||||
this.composerEditorController,
|
this.composerEditorController,
|
||||||
this.subjectEmailInputController,
|
this.subjectEmailInputController,
|
||||||
this._htmlMessagePurifier,
|
this._htmlMessagePurifier,
|
||||||
|
this.htmlEditorController,
|
||||||
|
this._localFilePickerInteractor,
|
||||||
|
this._uploadAttachmentInteractor,
|
||||||
);
|
);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -82,20 +97,29 @@ class ComposerController extends BaseController {
|
|||||||
void onDone() {
|
void onDone() {
|
||||||
viewState.value.fold(
|
viewState.value.fold(
|
||||||
(failure) {
|
(failure) {
|
||||||
_appToast.showErrorToast(AppLocalizations.of(Get.context!).error_message_sent);
|
if (failure is SendEmailFailure) {
|
||||||
Get.back();
|
_sendEmailFailure(failure);
|
||||||
|
} else if (failure is LocalFilePickerFailure || failure is LocalFilePickerCancel) {
|
||||||
|
_pickFileFailure(failure);
|
||||||
|
} else if (failure is UploadAttachmentFailure) {
|
||||||
|
_uploadAttachmentsFailure(failure);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
(success) {
|
(success) {
|
||||||
_saveEmailAddress();
|
if (success is SendEmailSuccess) {
|
||||||
_appToast.showSuccessToast(AppLocalizations.of(Get.context!).message_sent);
|
_sendEmailSuccess(success);
|
||||||
Get.back();
|
} else if (success is LocalFilePickerSuccess) {
|
||||||
|
_pickFileSuccess(success);
|
||||||
|
} else if (success is UploadAttachmentSuccess) {
|
||||||
|
_uploadAttachmentsSuccess(success);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onError(error) {
|
void onError(error) {
|
||||||
_appToast.showErrorToast(AppLocalizations.of(Get.context!).error_message_sent);
|
_appToast.showErrorToast(AppLocalizations.of(Get.context!).error_message_sent);
|
||||||
Get.back();
|
popBack();
|
||||||
}
|
}
|
||||||
|
|
||||||
void _getSelectedEmail() {
|
void _getSelectedEmail() {
|
||||||
@@ -275,6 +299,17 @@ class ComposerController extends BaseController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void _sendEmailSuccess(Success success) {
|
||||||
|
_saveEmailAddress();
|
||||||
|
_appToast.showSuccessToast(AppLocalizations.of(Get.context!).message_sent);
|
||||||
|
popBack();
|
||||||
|
}
|
||||||
|
|
||||||
|
void _sendEmailFailure(Failure failure) {
|
||||||
|
_appToast.showErrorToast(AppLocalizations.of(Get.context!).error_message_sent);
|
||||||
|
popBack();
|
||||||
|
}
|
||||||
|
|
||||||
void _saveEmailAddress() {
|
void _saveEmailAddress() {
|
||||||
final listEmailAddressCanSave = Set<EmailAddress>();
|
final listEmailAddressCanSave = Set<EmailAddress>();
|
||||||
listEmailAddressCanSave.addAll(listToEmailAddress + listCcEmailAddress + listBccEmailAddress);
|
listEmailAddressCanSave.addAll(listToEmailAddress + listCcEmailAddress + listBccEmailAddress);
|
||||||
@@ -306,6 +341,63 @@ class ComposerController extends BaseController {
|
|||||||
(success) => success is GetAutoCompleteSuccess ? success.listEmailAddress : <EmailAddress>[]));
|
(success) => success is GetAutoCompleteSuccess ? success.listEmailAddress : <EmailAddress>[]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void openPickAttachmentMenu(BuildContext context, List<Widget> actionTiles) {
|
||||||
|
(ContextMenuBuilder(context)
|
||||||
|
..addHeader(
|
||||||
|
(ContextMenuHeaderBuilder(Key('attachment_picker_context_menu_header_builder'))
|
||||||
|
..addLabel(AppLocalizations.of(context).pick_attachments))
|
||||||
|
.build())
|
||||||
|
..addTiles(actionTiles))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
void openFilePickerByType(BuildContext context, FileType fileType) async {
|
||||||
|
popBack();
|
||||||
|
consumeState(_localFilePickerInteractor.execute(fileType: fileType));
|
||||||
|
}
|
||||||
|
|
||||||
|
void _pickFileFailure(Failure failure) {
|
||||||
|
if (failure is LocalFilePickerFailure) {
|
||||||
|
if (Get.context != null) {
|
||||||
|
_appToast.showErrorToast(AppLocalizations.of(Get.context!).can_not_upload_this_file_as_attachments);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void _pickFileSuccess(Success success) {
|
||||||
|
if (success is LocalFilePickerSuccess) {
|
||||||
|
_uploadAttachmentsAction(success.fileInfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void _uploadAttachmentsAction(FileInfo fileInfo) async {
|
||||||
|
if (composerArguments.value != null) {
|
||||||
|
final accountId = composerArguments.value!.session.accounts.keys.first;
|
||||||
|
final uploadUrl = composerArguments.value!.session.getUploadUrl(accountId);
|
||||||
|
|
||||||
|
consumeState(_uploadAttachmentInteractor.execute(fileInfo, accountId, uploadUrl));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void _uploadAttachmentsFailure(Failure failure) {
|
||||||
|
if (Get.context != null) {
|
||||||
|
_appToast.showErrorToast(AppLocalizations.of(Get.context!).can_not_upload_this_file_as_attachments);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void _uploadAttachmentsSuccess(Success success) {
|
||||||
|
if (success is UploadAttachmentSuccess) {
|
||||||
|
attachments.add(success.attachment);
|
||||||
|
if (Get.context != null) {
|
||||||
|
_appToast.showSuccessToast(AppLocalizations.of(Get.context!).attachments_uploaded_successfully);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void removeAttachmentAction(Attachment attachmentRemoved) {
|
||||||
|
attachments.removeWhere((attachment) => attachment == attachmentRemoved);
|
||||||
|
}
|
||||||
|
|
||||||
void backToEmailViewAction() {
|
void backToEmailViewAction() {
|
||||||
Get.back();
|
Get.back();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,17 @@
|
|||||||
import 'package:core/core.dart';
|
import 'package:core/core.dart';
|
||||||
|
import 'package:file_picker/file_picker.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_svg/flutter_svg.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:html_editor_enhanced/html_editor.dart';
|
import 'package:html_editor_enhanced/html_editor.dart';
|
||||||
|
import 'package:model/email/attachment.dart';
|
||||||
|
import 'package:model/email/email_action_type.dart';
|
||||||
|
import 'package:tmail_ui_user/features/composer/domain/state/upload_attachment_state.dart';
|
||||||
import 'package:tmail_ui_user/features/composer/presentation/composer_controller.dart';
|
import 'package:tmail_ui_user/features/composer/presentation/composer_controller.dart';
|
||||||
import 'package:tmail_ui_user/features/composer/presentation/widgets/email_address_composer_widget_builder.dart';
|
import 'package:tmail_ui_user/features/composer/presentation/widgets/email_address_composer_widget_builder.dart';
|
||||||
import 'package:tmail_ui_user/features/composer/presentation/widgets/top_bar_composer_widget_builder.dart';
|
import 'package:tmail_ui_user/features/composer/presentation/widgets/top_bar_composer_widget_builder.dart';
|
||||||
|
import 'package:tmail_ui_user/features/email/presentation/widgets/attachment_file_tile_builder.dart';
|
||||||
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
||||||
|
|
||||||
class ComposerView extends GetWidget<ComposerController> {
|
class ComposerView extends GetWidget<ComposerController> {
|
||||||
@@ -50,12 +56,40 @@ class ComposerView extends GetWidget<ComposerController> {
|
|||||||
padding: EdgeInsets.symmetric(horizontal: 12, vertical: 8),
|
padding: EdgeInsets.symmetric(horizontal: 12, vertical: 8),
|
||||||
child: Obx(() => (TopBarComposerWidgetBuilder(imagePaths, controller.isEnableEmailSendButton.value)
|
child: Obx(() => (TopBarComposerWidgetBuilder(imagePaths, controller.isEnableEmailSendButton.value)
|
||||||
..addSendEmailActionClick(() => controller.sendEmailAction(context))
|
..addSendEmailActionClick(() => controller.sendEmailAction(context))
|
||||||
|
..addAttachFileActionClick(() => controller.openPickAttachmentMenu(context, _pickAttachmentsActionTiles(context)))
|
||||||
..addBackActionClick(() => controller.backToEmailViewAction()))
|
..addBackActionClick(() => controller.backToEmailViewAction()))
|
||||||
.build()),
|
.build()),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildEmailHeader(BuildContext context) {
|
Widget _buildEmailHeader(BuildContext context) {
|
||||||
|
List<Widget> _pickAttachmentsActionTiles(BuildContext context) {
|
||||||
|
return [
|
||||||
|
_pickPhotoAndVideoAction(context),
|
||||||
|
_browseFileAction(context),
|
||||||
|
SizedBox(height: 30),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _pickPhotoAndVideoAction(BuildContext context) {
|
||||||
|
return (SimpleContextMenuActionBuilder(
|
||||||
|
Key('pick_photo_and_video_context_menu_action'),
|
||||||
|
SvgPicture.asset(imagePaths.icPhotoLibrary, width: 24, height: 24, fit: BoxFit.fill),
|
||||||
|
AppLocalizations.of(context).photos_and_videos)
|
||||||
|
..onActionClick((_) => controller.openFilePickerByType(context, FileType.media)))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _browseFileAction(BuildContext context) {
|
||||||
|
return (SimpleContextMenuActionBuilder(
|
||||||
|
Key('browse_file_context_menu_action'),
|
||||||
|
SvgPicture.asset(imagePaths.icMore, width: 24, height: 24, fit: BoxFit.fill),
|
||||||
|
AppLocalizations.of(context).browse)
|
||||||
|
..onActionClick((_) => controller.openFilePickerByType(context, FileType.any)))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildEmailHeaderField(BuildContext context) {
|
||||||
return Container(
|
return Container(
|
||||||
margin: EdgeInsets.zero,
|
margin: EdgeInsets.zero,
|
||||||
padding: EdgeInsets.only(top: 20),
|
padding: EdgeInsets.only(top: 20),
|
||||||
@@ -120,6 +154,10 @@ class ComposerView extends GetWidget<ComposerController> {
|
|||||||
padding: EdgeInsets.only(bottom: 30, top: 16, left: 16, right: 16),
|
padding: EdgeInsets.only(bottom: 30, top: 16, left: 16, right: 16),
|
||||||
child: _buildComposerEditer(context),
|
child: _buildComposerEditer(context),
|
||||||
)
|
)
|
||||||
|
child: _buildEmailBodyEditorQuoted(context),
|
||||||
|
),
|
||||||
|
_buildLoadingView(),
|
||||||
|
_buildAttachments(context),
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@@ -143,4 +181,43 @@ class ComposerView extends GetWidget<ComposerController> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Widget _buildLoadingView() {
|
||||||
|
return Obx(() => controller.viewState.value.fold(
|
||||||
|
(failure) => SizedBox.shrink(),
|
||||||
|
(success) => success is UploadAttachmentLoadingState
|
||||||
|
? Center(child: Padding(
|
||||||
|
padding: EdgeInsets.only(top: 8),
|
||||||
|
child: SizedBox(
|
||||||
|
width: 20,
|
||||||
|
height: 20,
|
||||||
|
child: CircularProgressIndicator(color: AppColor.primaryColor))))
|
||||||
|
: SizedBox.shrink()));
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildAttachments(BuildContext context) {
|
||||||
|
return Obx(() => controller.attachments.isNotEmpty
|
||||||
|
? ListView.builder(
|
||||||
|
shrinkWrap: true,
|
||||||
|
primary: false,
|
||||||
|
key: Key('attachment_list'),
|
||||||
|
padding: EdgeInsets.only(top: 16, bottom: 24, right: 50, left: 24),
|
||||||
|
itemCount: controller.attachments.length,
|
||||||
|
itemBuilder: (context, index) => (AttachmentFileTileBuilder(
|
||||||
|
imagePaths,
|
||||||
|
controller.attachments[index],
|
||||||
|
0,
|
||||||
|
0)
|
||||||
|
..height(60)
|
||||||
|
..addButtonAction(_buildRemoveButtonAttachment(controller.attachments[index])))
|
||||||
|
.build())
|
||||||
|
: SizedBox.shrink());
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildRemoveButtonAttachment(Attachment attachment) {
|
||||||
|
return (IconBuilder(imagePaths.icComposerClose)
|
||||||
|
..size(35)
|
||||||
|
..addOnTapActionClick(() => controller.removeAttachmentAction(attachment)))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -5,10 +5,12 @@ import 'package:flutter/widgets.dart';
|
|||||||
|
|
||||||
typedef OnBackActionClick = void Function();
|
typedef OnBackActionClick = void Function();
|
||||||
typedef OnSendEmailActionClick = void Function();
|
typedef OnSendEmailActionClick = void Function();
|
||||||
|
typedef OnAttachFileActionClick = void Function();
|
||||||
|
|
||||||
class TopBarComposerWidgetBuilder {
|
class TopBarComposerWidgetBuilder {
|
||||||
OnBackActionClick? _onBackActionClick;
|
OnBackActionClick? _onBackActionClick;
|
||||||
OnSendEmailActionClick? _onSendEmailActionClick;
|
OnSendEmailActionClick? _onSendEmailActionClick;
|
||||||
|
OnAttachFileActionClick? _onAttachFileActionClick;
|
||||||
|
|
||||||
final ImagePaths _imagePaths;
|
final ImagePaths _imagePaths;
|
||||||
final bool _isEnableEmailSendButton;
|
final bool _isEnableEmailSendButton;
|
||||||
@@ -23,6 +25,10 @@ class TopBarComposerWidgetBuilder {
|
|||||||
_onSendEmailActionClick = onSendEmailActionClick;
|
_onSendEmailActionClick = onSendEmailActionClick;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void addAttachFileActionClick(OnAttachFileActionClick onAttachFileActionClick) {
|
||||||
|
_onAttachFileActionClick = onAttachFileActionClick;
|
||||||
|
}
|
||||||
|
|
||||||
Widget build() {
|
Widget build() {
|
||||||
return Container(
|
return Container(
|
||||||
key: Key('top_bar_composer_widget'),
|
key: Key('top_bar_composer_widget'),
|
||||||
@@ -64,7 +70,13 @@ class TopBarComposerWidgetBuilder {
|
|||||||
children: [
|
children: [
|
||||||
ButtonBuilder(_imagePaths.icComposerFileShare).key(Key('button_file_share')).build(),
|
ButtonBuilder(_imagePaths.icComposerFileShare).key(Key('button_file_share')).build(),
|
||||||
SizedBox(width: 2),
|
SizedBox(width: 2),
|
||||||
ButtonBuilder(_imagePaths.icShare).key(Key('button_attachment')).build(),
|
ButtonBuilder(_imagePaths.icShare)
|
||||||
|
.key(Key('button_attachment'))
|
||||||
|
.onPressActionClick(() {
|
||||||
|
if (_onAttachFileActionClick != null) {
|
||||||
|
_onAttachFileActionClick!();
|
||||||
|
}})
|
||||||
|
.build(),
|
||||||
SizedBox(width: 2),
|
SizedBox(width: 2),
|
||||||
ButtonBuilder(_imagePaths.icComposerSend)
|
ButtonBuilder(_imagePaths.icComposerSend)
|
||||||
.key(Key('button_send_email'))
|
.key(Key('button_send_email'))
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import 'package:core/core.dart';
|
import 'package:core/core.dart';
|
||||||
|
import 'package:core/presentation/views/dialog/downloading_file_dialog_builder.dart';
|
||||||
import 'package:dartz/dartz.dart';
|
import 'package:dartz/dartz.dart';
|
||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
|
|||||||
@@ -2,5 +2,11 @@ import 'package:jmap_dart_client/jmap/mail/email/email_body_part.dart';
|
|||||||
import 'package:model/model.dart';
|
import 'package:model/model.dart';
|
||||||
|
|
||||||
extension EmailBodyPartExtension on EmailBodyPart {
|
extension EmailBodyPartExtension on EmailBodyPart {
|
||||||
Attachment toAttachment() => Attachment(partId, blobId, size, name, type, cid);
|
Attachment toAttachment() => Attachment(
|
||||||
|
partId: partId,
|
||||||
|
blobId: blobId,
|
||||||
|
size: size,
|
||||||
|
name: name,
|
||||||
|
type: type,
|
||||||
|
cid: cid);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import 'package:jmap_dart_client/jmap/mail/email/email_body_part.dart';
|
import 'package:jmap_dart_client/jmap/mail/email/email_body_part.dart';
|
||||||
import 'package:model/email/email_content.dart';
|
|
||||||
import 'package:tmail_ui_user/features/email/presentation/constants/email_constants.dart';
|
import 'package:tmail_ui_user/features/email/presentation/constants/email_constants.dart';
|
||||||
import 'package:model/model.dart';
|
import 'package:model/model.dart';
|
||||||
import 'package:tmail_ui_user/features/email/presentation/model/message_content.dart';
|
import 'package:tmail_ui_user/features/email/presentation/model/message_content.dart';
|
||||||
|
|||||||
@@ -20,6 +20,9 @@ class AttachmentFileTileBuilder {
|
|||||||
OnDownloadAttachmentFileActionClick? _onDownloadAttachmentFileActionClick;
|
OnDownloadAttachmentFileActionClick? _onDownloadAttachmentFileActionClick;
|
||||||
OnExpandAttachmentActionClick? _onExpandAttachmentActionClick;
|
OnExpandAttachmentActionClick? _onExpandAttachmentActionClick;
|
||||||
|
|
||||||
|
Widget? buttonAction;
|
||||||
|
double? heightItem;
|
||||||
|
|
||||||
AttachmentFileTileBuilder(
|
AttachmentFileTileBuilder(
|
||||||
this._imagePaths,
|
this._imagePaths,
|
||||||
this._attachment,
|
this._attachment,
|
||||||
@@ -39,6 +42,14 @@ class AttachmentFileTileBuilder {
|
|||||||
_expandMode = expandMode;
|
_expandMode = expandMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void addButtonAction(Widget action) {
|
||||||
|
buttonAction = action;
|
||||||
|
}
|
||||||
|
|
||||||
|
void height(double height) {
|
||||||
|
heightItem = height;
|
||||||
|
}
|
||||||
|
|
||||||
Widget build() {
|
Widget build() {
|
||||||
return Theme(
|
return Theme(
|
||||||
data: ThemeData(
|
data: ThemeData(
|
||||||
@@ -47,6 +58,8 @@ class AttachmentFileTileBuilder {
|
|||||||
child: Container(
|
child: Container(
|
||||||
key: Key('attach_file_tile'),
|
key: Key('attach_file_tile'),
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
|
margin: EdgeInsets.only(top:heightItem != null ? 8 : 0),
|
||||||
|
height: heightItem ?? null,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(8),
|
borderRadius: BorderRadius.circular(8),
|
||||||
border: Border.all(color: AppColor.attachmentFileBorderColor),
|
border: Border.all(color: AppColor.attachmentFileBorderColor),
|
||||||
@@ -83,6 +96,11 @@ class AttachmentFileTileBuilder {
|
|||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
style: TextStyle(fontSize: 12, color: AppColor.attachmentFileSizeColor)))
|
style: TextStyle(fontSize: 12, color: AppColor.attachmentFileSizeColor)))
|
||||||
|
: null,
|
||||||
|
trailing: buttonAction != null
|
||||||
|
? Transform(
|
||||||
|
transform: Matrix4.translationValues(6.0, heightItem != null ? -6.0 : 0.0, 0.0),
|
||||||
|
child: buttonAction)
|
||||||
: null
|
: null
|
||||||
),
|
),
|
||||||
Transform(
|
Transform(
|
||||||
|
|||||||
@@ -303,5 +303,41 @@
|
|||||||
"type": "text",
|
"type": "text",
|
||||||
"placeholders_order": [],
|
"placeholders_order": [],
|
||||||
"placeholders": {}
|
"placeholders": {}
|
||||||
|
},
|
||||||
|
"attach_file_prepare_text": "Preparing to attach file...",
|
||||||
|
"@attach_file_prepare_text": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders_order": [],
|
||||||
|
"placeholders": {}
|
||||||
|
},
|
||||||
|
"can_not_upload_this_file_as_attachments": "Can not upload this file as attachments",
|
||||||
|
"@can_not_upload_this_file_as_attachments": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders_order": [],
|
||||||
|
"placeholders": {}
|
||||||
|
},
|
||||||
|
"attachments_uploaded_successfully": "Attachments uploaded successfully",
|
||||||
|
"@attachments_uploaded_successfully": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders_order": [],
|
||||||
|
"placeholders": {}
|
||||||
|
},
|
||||||
|
"pick_attachments": "Pick attachments",
|
||||||
|
"@pick_attachments": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders_order": [],
|
||||||
|
"placeholders": {}
|
||||||
|
},
|
||||||
|
"photos_and_videos": "Photos and Videos",
|
||||||
|
"@photos_and_videos": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders_order": [],
|
||||||
|
"placeholders": {}
|
||||||
|
},
|
||||||
|
"browse": "Browse",
|
||||||
|
"@browse": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders_order": [],
|
||||||
|
"placeholders": {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -303,5 +303,41 @@
|
|||||||
"type": "text",
|
"type": "text",
|
||||||
"placeholders_order": [],
|
"placeholders_order": [],
|
||||||
"placeholders": {}
|
"placeholders": {}
|
||||||
|
},
|
||||||
|
"attach_file_prepare_text": "Preparing to attach file...",
|
||||||
|
"@attach_file_prepare_text": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders_order": [],
|
||||||
|
"placeholders": {}
|
||||||
|
},
|
||||||
|
"can_not_upload_this_file_as_attachments": "Can not upload this file as attachments",
|
||||||
|
"@can_not_upload_this_file_as_attachments": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders_order": [],
|
||||||
|
"placeholders": {}
|
||||||
|
},
|
||||||
|
"attachments_uploaded_successfully": "Attachments uploaded successfully",
|
||||||
|
"@attachments_uploaded_successfully": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders_order": [],
|
||||||
|
"placeholders": {}
|
||||||
|
},
|
||||||
|
"pick_attachments": "Pick attachments",
|
||||||
|
"@pick_attachments": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders_order": [],
|
||||||
|
"placeholders": {}
|
||||||
|
},
|
||||||
|
"photos_and_videos": "Photos and Videos",
|
||||||
|
"@photos_and_videos": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders_order": [],
|
||||||
|
"placeholders": {}
|
||||||
|
},
|
||||||
|
"browse": "Browse",
|
||||||
|
"@browse": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders_order": [],
|
||||||
|
"placeholders": {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"@@last_modified": "2021-09-16T14:31:23.463339",
|
"@@last_modified": "2021-09-17T17:37:57.805293",
|
||||||
"initializing_data": "Initializing data...",
|
"initializing_data": "Initializing data...",
|
||||||
"@initializing_data": {
|
"@initializing_data": {
|
||||||
"type": "text",
|
"type": "text",
|
||||||
@@ -303,5 +303,41 @@
|
|||||||
"type": "text",
|
"type": "text",
|
||||||
"placeholders_order": [],
|
"placeholders_order": [],
|
||||||
"placeholders": {}
|
"placeholders": {}
|
||||||
|
},
|
||||||
|
"attach_file_prepare_text": "Preparing to attach file...",
|
||||||
|
"@attach_file_prepare_text": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders_order": [],
|
||||||
|
"placeholders": {}
|
||||||
|
},
|
||||||
|
"can_not_upload_this_file_as_attachments": "Can not upload this file as attachments",
|
||||||
|
"@can_not_upload_this_file_as_attachments": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders_order": [],
|
||||||
|
"placeholders": {}
|
||||||
|
},
|
||||||
|
"attachments_uploaded_successfully": "Attachments uploaded successfully",
|
||||||
|
"@attachments_uploaded_successfully": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders_order": [],
|
||||||
|
"placeholders": {}
|
||||||
|
},
|
||||||
|
"pick_attachments": "Pick attachments",
|
||||||
|
"@pick_attachments": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders_order": [],
|
||||||
|
"placeholders": {}
|
||||||
|
},
|
||||||
|
"photos_and_videos": "Photos and Videos",
|
||||||
|
"@photos_and_videos": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders_order": [],
|
||||||
|
"placeholders": {}
|
||||||
|
},
|
||||||
|
"browse": "Browse",
|
||||||
|
"@browse": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders_order": [],
|
||||||
|
"placeholders": {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -303,5 +303,41 @@
|
|||||||
"type": "text",
|
"type": "text",
|
||||||
"placeholders_order": [],
|
"placeholders_order": [],
|
||||||
"placeholders": {}
|
"placeholders": {}
|
||||||
|
},
|
||||||
|
"attach_file_prepare_text": "Preparing to attach file...",
|
||||||
|
"@attach_file_prepare_text": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders_order": [],
|
||||||
|
"placeholders": {}
|
||||||
|
},
|
||||||
|
"can_not_upload_this_file_as_attachments": "Can not upload this file as attachments",
|
||||||
|
"@can_not_upload_this_file_as_attachments": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders_order": [],
|
||||||
|
"placeholders": {}
|
||||||
|
},
|
||||||
|
"attachments_uploaded_successfully": "Attachments uploaded successfully",
|
||||||
|
"@attachments_uploaded_successfully": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders_order": [],
|
||||||
|
"placeholders": {}
|
||||||
|
},
|
||||||
|
"pick_attachments": "Pick attachments",
|
||||||
|
"@pick_attachments": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders_order": [],
|
||||||
|
"placeholders": {}
|
||||||
|
},
|
||||||
|
"photos_and_videos": "Photos and Videos",
|
||||||
|
"@photos_and_videos": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders_order": [],
|
||||||
|
"placeholders": {}
|
||||||
|
},
|
||||||
|
"browse": "Browse",
|
||||||
|
"@browse": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders_order": [],
|
||||||
|
"placeholders": {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -303,5 +303,41 @@
|
|||||||
"type": "text",
|
"type": "text",
|
||||||
"placeholders_order": [],
|
"placeholders_order": [],
|
||||||
"placeholders": {}
|
"placeholders": {}
|
||||||
|
},
|
||||||
|
"attach_file_prepare_text": "Preparing to attach file...",
|
||||||
|
"@attach_file_prepare_text": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders_order": [],
|
||||||
|
"placeholders": {}
|
||||||
|
},
|
||||||
|
"can_not_upload_this_file_as_attachments": "Can not upload this file as attachments",
|
||||||
|
"@can_not_upload_this_file_as_attachments": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders_order": [],
|
||||||
|
"placeholders": {}
|
||||||
|
},
|
||||||
|
"attachments_uploaded_successfully": "Attachments uploaded successfully",
|
||||||
|
"@attachments_uploaded_successfully": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders_order": [],
|
||||||
|
"placeholders": {}
|
||||||
|
},
|
||||||
|
"pick_attachments": "Pick attachments",
|
||||||
|
"@pick_attachments": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders_order": [],
|
||||||
|
"placeholders": {}
|
||||||
|
},
|
||||||
|
"photos_and_videos": "Photos and Videos",
|
||||||
|
"@photos_and_videos": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders_order": [],
|
||||||
|
"placeholders": {}
|
||||||
|
},
|
||||||
|
"browse": "Browse",
|
||||||
|
"@browse": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders_order": [],
|
||||||
|
"placeholders": {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5,6 +5,7 @@ import 'package:dio/dio.dart';
|
|||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:jmap_dart_client/http/http_client.dart' as JmapHttpClient;
|
import 'package:jmap_dart_client/http/http_client.dart' as JmapHttpClient;
|
||||||
|
import 'package:tmail_ui_user/features/composer/data/network/composer_api.dart';
|
||||||
import 'package:tmail_ui_user/features/email/data/network/email_api.dart';
|
import 'package:tmail_ui_user/features/email/data/network/email_api.dart';
|
||||||
import 'package:tmail_ui_user/features/mailbox/data/network/mailbox_api.dart';
|
import 'package:tmail_ui_user/features/mailbox/data/network/mailbox_api.dart';
|
||||||
import 'package:tmail_ui_user/features/session/data/network/session_api.dart';
|
import 'package:tmail_ui_user/features/session/data/network/session_api.dart';
|
||||||
@@ -53,5 +54,6 @@ class NetworkBindings extends Bindings {
|
|||||||
Get.put(EmailAPI(
|
Get.put(EmailAPI(
|
||||||
Get.find<JmapHttpClient.HttpClient>(),
|
Get.find<JmapHttpClient.HttpClient>(),
|
||||||
Get.find<DownloadManager>()));
|
Get.find<DownloadManager>()));
|
||||||
|
Get.put(ComposerAPI(Get.find<DioClient>()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -351,5 +351,47 @@ class AppLocalizations {
|
|||||||
args: [count]
|
args: [count]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String get attach_file_prepare_text {
|
||||||
|
return Intl.message(
|
||||||
|
'Preparing to attach file...',
|
||||||
|
name: 'attach_file_prepare_text'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
String get can_not_upload_this_file_as_attachments {
|
||||||
|
return Intl.message(
|
||||||
|
'Can not upload this file as attachments',
|
||||||
|
name: 'can_not_upload_this_file_as_attachments'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
String get attachments_uploaded_successfully {
|
||||||
|
return Intl.message(
|
||||||
|
'Attachments uploaded successfully',
|
||||||
|
name: 'attachments_uploaded_successfully'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
String get pick_attachments {
|
||||||
|
return Intl.message(
|
||||||
|
'Pick attachments',
|
||||||
|
name: 'pick_attachments'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
String get photos_and_videos {
|
||||||
|
return Intl.message(
|
||||||
|
'Photos and Videos',
|
||||||
|
name: 'photos_and_videos',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
String get browse {
|
||||||
|
return Intl.message(
|
||||||
|
'Browse',
|
||||||
|
name: 'browse',
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user