Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/enough-software/enough_mail_flutter
Flutter widgets for mail apps. Licensed commercially friendly under MPL 2.0.
https://github.com/enough-software/enough_mail_flutter
dart flutter imap mail mime
Last synced: 2 days ago
JSON representation
Flutter widgets for mail apps. Licensed commercially friendly under MPL 2.0.
- Host: GitHub
- URL: https://github.com/enough-software/enough_mail_flutter
- Owner: Enough-Software
- License: mpl-2.0
- Created: 2020-12-04T11:03:47.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-07-13T08:11:49.000Z (4 months ago)
- Last Synced: 2024-07-13T09:26:59.204Z (4 months ago)
- Topics: dart, flutter, imap, mail, mime
- Language: Dart
- Homepage:
- Size: 96.7 KB
- Stars: 13
- Watchers: 6
- Forks: 15
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# enough_mail_flutter
Flutter widgets for email apps based on [enough_mail](https://pub.dev/packages/enough_mail).
## Usage
The `enough_mail_flutter` package contains the following widgets:
* `MimeMessageViewer` to display emails for which the contents has been already downloaded.
* `MimeMessageDownloader` to download message contents first if required - then uses the `MimeMessageViewer` to display.### MimeMessageViewer Usage
Using the `MimeMessageViewer` is quite straight forward:```dart
import 'package:enough_mail/enough_mail.dart';
import 'package:enough_mail_flutter/enough_mail_flutter.dart';Widget build(MimeMessage mimeMessage) {
return MimeMessageViewer(
mimeMessage: mimeMessage,
blockExternalImages: false,
mailtoDelegate: handleMailto,
);
}Future handleMailto(Uri mailto, MimeMessage mimeMessage) {
final messageBuilder =
MessageBuilder.prepareMailtoBasedMessage(mailto, MyAccount.instance.fromAddress);
return locator()
.push(Routes.mailCompose, arguments: messageBuilder);
}```
### MimeMessageDownloader Usage
The `MimeMessageDownloader` downloads the message contents first if required and then uses the `MimeMessageViewer` to display the contents.
You can specify most of the `MimeMessageViewer` options also on the `MimeMessageDownloader`. Refer to the API documentation for other specific configuration options.The implementation assumes that the `size` and `envelope` information have been previously downloaded,
e.g. using `MailClient.fetchMessages(fetchPreference: FetchPreference.envelope)`.```dart
Widget buildViewerForMessage(MimeMessage mimeMessage, MailClient mailClient) {
return MimeMessageDownloader(
mimeMessage: mimeMessage,
mailClient: mailClient,
onDownloaded: onMessageDownloaded,
blockExternalImages: false,
markAsSeen: true,
mailtoDelegate: handleMailto,
);
}void onMessageDownloaded(MimeMessage mimeMessage) {
// update other things to show eg attachment view, e.g.:
//setState(() {});
}
```## Installation
Add this dependency your `pubspec.yaml` file:```
dependencies:
enough_mail_flutter: ^2.0.0
```
The latest version or `enough_mail_flutter` is [![enough_mail_flutter version](https://img.shields.io/pub/v/enough_mail_flutter.svg)](https://pub.dartlang.org/packages/enough_mail_flutter).Note: you might need to set a dependency override for the xml package:
```
dependency_overrides:
xml: ^6.0.1
```## Features and bugs
Please file feature requests and bugs at the [issue tracker][tracker].
[tracker]: https://github.com/enough-software/enough_mail_flutter/issues
## License
Licensed under the commercial friendly [Mozilla Public License 2.0](LICENSE).