Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Email fixes #38

Merged
merged 16 commits into from
Jan 23, 2024
Merged
6 changes: 4 additions & 2 deletions apps/onyx/lib/l10n/app_ar.arb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"onyx": "الجزع",
"initialization": "التهيئة",
"yes": "نعم",
"no": "لا",
"onyxSubTitle": "ل ليون 1",
"authentication": "المصادقة",
"privacy": "سرية",
Expand Down Expand Up @@ -82,7 +83,7 @@
"to": "الى",
"me": "موي",
"mailSendPageErrorTitle": "يرجى ملء جميع الحقول بشكل صحيح",
"objects": "أشياء",
"subject": "موضوع",
"reply": "إجابة",
"mailServerConnection": "اتصال بخادم البريد",
"mailServerConnectionError": "خطأ في تحميل البريد الإلكتروني",
Expand Down Expand Up @@ -206,5 +207,6 @@
"unableToOpenLink": "من المستحيل فتح الرابط",
"chooseLanguage": "اختر اللغة",
"auto": "تلقائي",
"realyQuit": "حقيقة تريد الاستقالة؟"
"realyQuit": "حقيقة تريد الاستقالة؟",
"response": "استجابة"
}
14 changes: 11 additions & 3 deletions apps/onyx/lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
"@yes": {
"description": "Yes"
},
"no": "No",
"@no": {
"description": "No"
},
"onyxSubTitle": "For Lyon 1",
"@onyxSubTitle": {
"description": "The subtitle under the name Onyx"
Expand Down Expand Up @@ -340,9 +344,9 @@
"@mailSendPageErrorTitle": {
"description": "Please fill all the fields correctly"
},
"objects": "Objects",
"@objects": {
"description": "Objects"
"subject": "subject",
"@subject": {
"description": "subject"
},
"reply": "Reply",
"@reply": {
Expand Down Expand Up @@ -982,5 +986,9 @@
"realyQuit": "Do you really want to quit?",
"@realyQuit": {
"description": "Do you really want to quit?"
},
"response": "Response",
"@response": {
"description": "Response"
}
}
6 changes: 4 additions & 2 deletions apps/onyx/lib/l10n/app_fr.arb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"onyx": "Onyx",
"initialization": "Initialisation",
"yes": "Oui",
"no": "Non",
"onyxSubTitle": "Pour Lyon 1",
"authentication": "Authentification",
"privacy": "Confidentialité",
Expand Down Expand Up @@ -82,7 +83,7 @@
"to": "À",
"me": "Moi",
"mailSendPageErrorTitle": "Veuillez remplir correctement tous les champs",
"objects": "Objets",
"subject": "Objets",
"reply": "Réponse",
"mailServerConnection": "Connexion au serveur de mail",
"mailServerConnectionError": "Erreur de chargement des mails",
Expand Down Expand Up @@ -206,5 +207,6 @@
"unableToOpenLink": "Impossible d''ouvrir le lien",
"chooseLanguage": "Choisir la langue",
"auto": "Automatique",
"realyQuit": "Voulez-vous vraiment quitter ?"
"realyQuit": "Voulez-vous vraiment quitter ?",
"response": "Réponse"
}
6 changes: 4 additions & 2 deletions apps/onyx/lib/l10n/app_ru.arb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"onyx": "Оникс",
"initialization": "Инициализация",
"yes": "Да",
"no": "Нет",
"onyxSubTitle": "Для Лиона 1",
"authentication": "Аутентификация",
"privacy": "Конфиденциальность",
Expand Down Expand Up @@ -82,7 +83,7 @@
"to": "Кому",
"me": "Мне",
"mailSendPageErrorTitle": "Пожалуйста, заполните все поля правильно",
"objects": "Объекты",
"subject": "Тема",
"reply": "Ответить",
"mailServerConnection": "Подключение к почтовому серверу",
"mailServerConnectionError": "Ошибка подключения к почтовому серверу",
Expand Down Expand Up @@ -207,5 +208,6 @@
"chooseLanguage": "Выберите язык",
"auto": "Автоматически",
"unflagedEmail": "Неотмеченное письмо: {subject}",
"realyQuit": "Вы действительно хотите бросить курить?"
"realyQuit": "Вы действительно хотите бросить курить?",
"response": "Ответ"
}
2 changes: 2 additions & 0 deletions apps/onyx/lib/screens/mails/mails_export.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export 'pages/email_details_page.dart';
export 'pages/email_send_page.dart';
export 'pages/emails_page.dart';
export 'states/email_cubit.dart';
export 'states/email_send_cubit.dart';
export 'widgets/details/email_content_widget.dart';
export 'widgets/email_attachment_widget.dart';
export 'widgets/email_bottom_nav_bar_icon.dart';
Expand All @@ -13,3 +14,4 @@ export 'widgets/email_widget.dart';
export 'widgets/save_or_open_dialog_widget.dart';
export 'widgets/send/email_send_attachment_widget.dart';
export 'widgets/send/email_send_autocomplete_widget.dart';
export 'widgets/send/email_send_bottom_bar_widget.dart';
99 changes: 48 additions & 51 deletions apps/onyx/lib/screens/mails/pages/email_details_page.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'dart:io';
import 'package:animations/animations.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
Expand Down Expand Up @@ -96,63 +95,61 @@ class MailDetailsPage extends StatelessWidget {
SizedBox(
height: 1.h,
),
if (mail.attachments.isNotEmpty)
Container(
color: Theme.of(context).cardTheme.color,
padding: EdgeInsets.all(1.h),
height: 7.h,
child: ListView.builder(
scrollDirection: Axis.horizontal,
itemCount: mail.attachments.length,
itemBuilder: (context, index) {
return Padding(
padding:
const EdgeInsets.symmetric(horizontal: 8.0),
child: MailAttachmentWidget(
fileName: mail.attachments[index],
onTap: () async {
//save data in a file and open it
if (mail.attachmentsFiles
.where((element) => element.path
.contains(mail.attachments[1]))
.isEmpty) {
mail.attachmentsFiles.insert(
index,
await AttachmentLogic
.getAttachmentLocalPath(
email: mail,
mailClient: context
.read<EmailCubit>()
.mailClient!,
emailNumber: state.emailNumber,
fileName: mail.attachments[index],
folder: state.currentMailBox!,
appLocalizations:
AppLocalizations.of(context)
));
}
// ignore: use_build_context_synchronously
showDialog(
context: context,
builder: (_) => SaveOrOpenDialogWidget(
filePath:
mail.attachmentsFiles[index].path,
));
},
),
);
},
),
),
Container(
color: Theme.of(context).cardTheme.color,
height: (mail.attachments.isNotEmpty) ? 57.h : 70.h,
width: 100.w,
padding: EdgeInsets.all(1.h),
child: MailContentWidget(mail: mail),
),
(mail.attachments.isNotEmpty)
? Container(
color: Theme.of(context).cardTheme.color,
padding: EdgeInsets.all(0.5.h),
height: 12.h,
width: 100.w,
child: ListView.builder(
scrollDirection: Axis.horizontal,
itemCount: mail.attachments.length,
itemBuilder: (context, index) {
return MailAttachmentWidget(
fileName: mail.attachments[index],
onTap: () async {
//save data in a file and open it
if (mail.attachmentsFiles
.where((element) => element.path
.contains(mail.attachments[index]))
.isEmpty) {
mail.attachmentsFiles.addAll(List.generate(
index -
mail.attachmentsFiles.length +
1,
(index) => File("")));
mail.attachmentsFiles[index] =
await AttachmentLogic
.getAttachmentLocalPath(
email: mail,
mailClient: context
.read<EmailCubit>()
.mailClient!,
emailNumber: state.emailNumber,
fileName: mail.attachments[index],
folder: state.currentMailBox!,
appLocalizations:
AppLocalizations.of(context),
);
}
// ignore: use_build_context_synchronously
showDialog(
context: context,
builder: (_) => SaveOrOpenDialogWidget(
filePath: mail
.attachmentsFiles[index].path,
));
},
);
},
),
)
: Container(),
],
),
),
Expand Down
Loading
Loading