Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
robert-virkus committed Apr 5, 2024
2 parents ad6d53f + 1db52f8 commit fbc15b4
Show file tree
Hide file tree
Showing 12 changed files with 26 additions and 28 deletions.
29 changes: 8 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,20 @@
# Codename: Maily
Mail app for iOS, Android and hopefully more platforms in the future. Developed in [Flutter](https://flutter.dev).

## Test Maily
You can test an early access version of Maily today:
* on Android at [Google Play](https://play.google.com/store/apps/details?id=de.enough.enough_mail_app).
* on iOS with [TestFlight](https://testflight.apple.com/join/6TFIg0uJ).

## Screenshots Android
[<img src="screenshots/welcome.png" width="320"/>](screenshots/welcome.png)
[<img src="screenshots/compose_honey.png" width="320"/>](screenshots/compose_honey.png)
[<img src="screenshots/contact_interactions.png" width="320"/>](screenshots/contact_interactions.png)
[<img src="screenshots/message_actions.png" width="320"/>](screenshots/message_actions.png)
[<img src="screenshots/messages_actions.png" width="320"/>](screenshots/messages_actions.png)
[<img src="screenshots/design2.png" width="320"/>](screenshots/design2.png)
# enough_mail_app
Base mail components in Flutter.

For a full email app based on this project, see [maily](https://github.com/Enough-Software/maily).

## Features
* POP and IMAP service providers are supported, though POP accounts are not tested at this moment
* Multiple account support
* Unified account - when you have at least 2 accounts, a unified account will show up automatically - with unified inbox, sent, trash, etc
* Mail management: delete, mark as read/unread
* Unsubscribe from newslettters easily
* Unsubscribe from newsletters easily
* View attachments in app - photos, PDFs, video and audio files
* Compose messages: compose new messages and reply to/forward mails with WYSIWG editor
* Compose messages: compose new messages and reply to/forward mails with WYSIWYG editor
* Save and continue draft messages
* Attach photo-, audio-, video- or generic files. Attach your current location.
* Swipe right to left to delete and swipe left to right to mark as read/unread
* Personalizae swipe actions
* Personalize swipe actions
* Optionally you can block external images when viewing mails
* You can specify aliases and check for + alias support by your mail provider
* Swipe left or right in the message details to view the next/previous message
Expand Down Expand Up @@ -64,8 +53,6 @@ This is how you contribute:

When you have compile problems this is usually due to not getting the latest version from git. Call `flutter pub upgrade` to ensure that you are on the latest version of all referenced projects. Since translations are generated you can ignore all translation problems, just start the build, afterwards the localization compilation problems will be gone.

For some features you will need to add the relevant keys to *assets/keys.txt*, currently the following key is required:
* giphy: https://developers.giphy.com/

## Localizations
When you change translations, re-generate the translations files by calling `flutter gen-l10n`.
Expand All @@ -82,11 +69,11 @@ by calling `dart run build_runner build --delete-conflicting-outputs`.

## Related Projects
Check out these related projects:
* [maily](https://github.com/Enough-Software/maily) email app based on enough_mail_app.
* [enough_mail](https://github.com/Enough-Software/enough_mail) mail libraries in pure Dart.
* [enough_mail_html](https://github.com/Enough-Software/enough_mail_html) generates HTML out of a `MimeMessage`.
* [enough_mail_flutter](https://github.com/Enough-Software/enough_mail_flutter) provides some common Flutter widgets for any mail app.
* [enough_media](https://github.com/Enough-Software/enough_media) provides media rendering widgets.
* [enough_convert](https://github.com/Enough-Software/enough_convert) provides the encodings missing from `dart:convert`.


![Maily Logo](/maily.png)
9 changes: 9 additions & 0 deletions lib/src/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import 'keys/service.dart';
import 'localization/app_localizations.g.dart';
import 'lock/provider.dart';
import 'logger.dart';
import 'mail/service.dart';
import 'models/async_mime_source_factory.dart';
import 'notification/service.dart';
import 'routes/provider.dart';
import 'routes/routes.dart';
Expand All @@ -29,12 +31,19 @@ class EnoughMailApp extends HookConsumerWidget {
const EnoughMailApp({
super.key,
required this.appName,
this.mimeSourceFactory =
const AsyncMimeSourceFactory(isOfflineModeSupported: false),
});

/// The name of the app
final String appName;

final AsyncMimeSourceFactory mimeSourceFactory;

@override
Widget build(BuildContext context, WidgetRef ref) {
EmailService.mimeSourceFactory = mimeSourceFactory;

useOnAppLifecycleStateChange((previous, current) {
logger.d('raw AppLifecycleState changed from $previous to $current');
ref.read(rawAppLifecycleStateProvider.notifier).state = current;
Expand Down
8 changes: 5 additions & 3 deletions lib/src/mail/service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ class EmailService {
/// Retrieves the singleton instance
static EmailService get instance => _instance;

static const _clientId = Id(name: 'Maily', version: '1.0');
final _mimeSourceFactory =
/// The used mime source factory
static AsyncMimeSourceFactory mimeSourceFactory =
const AsyncMimeSourceFactory(isOfflineModeSupported: false);

static const _clientId = Id(name: 'Maily', version: '1.0');

/// Creates a mime source for the given account
Future<AsyncMimeSource> createMimeSource({
required MailClient mailClient,
Expand All @@ -33,7 +35,7 @@ class EmailService {
} else {
await mailClient.selectMailbox(mailbox);
}
final source = _mimeSourceFactory.createMailboxMimeSource(
final source = mimeSourceFactory.createMailboxMimeSource(
mailClient,
mailbox,
);
Expand Down
4 changes: 2 additions & 2 deletions lib/src/screens/compose_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ class _ComposeScreenState extends ConsumerState<ComposeScreen> {
return;
}
}
if (context.mounted) {
if (mounted) {
context.pop();
}
final mailClient = _getMailClient();
Expand Down Expand Up @@ -807,7 +807,7 @@ class _ComposeScreenState extends ConsumerState<ComposeScreen> {
Future<void> _showSourceCode() async {
final mailClient = _getMailClient();
final mime = await _buildMimeMessage(mailClient);
if (context.mounted) {
if (mounted) {
unawaited(context.pushNamed(Routes.sourceCode, extra: mime));
}
}
Expand Down
4 changes: 2 additions & 2 deletions lib/src/screens/message_source_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1108,12 +1108,12 @@ class _MessageSourceScreenState extends ConsumerState<MessageSourceScreen>
//message.updateMime(mime);
final builder = MessageBuilder.prepareFromDraft(mime);
final data = ComposeData([message], builder, ComposeAction.newMessage);
if (context.mounted) {
if (mounted) {
unawaited(context.pushNamed(Routes.mailCompose, extra: data));
}
} else {
// move to mail details:
if (context.mounted) {
if (mounted) {
unawaited(context.pushNamed(Routes.mailDetails, extra: message));
}
}
Expand Down
Binary file removed maily.png
Binary file not shown.
Binary file removed screenshots/compose_honey.png
Binary file not shown.
Binary file removed screenshots/contact_interactions.png
Binary file not shown.
Binary file removed screenshots/design2.png
Binary file not shown.
Binary file removed screenshots/message_actions.png
Binary file not shown.
Binary file removed screenshots/messages_actions.png
Binary file not shown.
Binary file removed screenshots/welcome.png
Binary file not shown.

0 comments on commit fbc15b4

Please sign in to comment.