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

Linux desktop support #63

Open
maks opened this issue Jan 31, 2022 · 9 comments
Open

Linux desktop support #63

maks opened this issue Jan 31, 2022 · 9 comments
Labels
desktop Support for desktops (Linux, MacOS, Windows)

Comments

@maks
Copy link

maks commented Jan 31, 2022

I got the app (current main branch) running on Linux with just a simple flutter create --platforms=linux .
The onboarding, account config and inbox list screen all work fine. But the mail view is the main issue at the moment, as the stumbling block is the lack of desktop support for webview's (on any desktop not just LInux) which in turn for Linux is blocked on missing Platform view support for linux.

The good news is that it seems that 41724 might bring platform view support soon, which would then hopefully mean webview follows soon after.

In the meantime, I wonder if we could have add an option to use a plain Text view instead of a Webview for email bodies?

@robert-virkus robert-virkus added the desktop Support for desktops (Linux, MacOS, Windows) label Jan 31, 2022
@robert-virkus
Copy link
Member

Thanks for pushing the envelope (pun intended)!

The webview is used for both displaying emails and composing messages.

It might be possible to test one of the following libraries for general desktop support:

Some other options:

Some of the previous problems in regards to web support for memory consumption (since the webview is part of a custom scrollview), scaling (this is still a problem for some messages) and ensuring to be able to load locally generated HTML.

Maily has a plain-text option in it's security settings, but even that setting currently uses a webview, so that links become tappable/clickable.

So one intermediate option might indeed be to switch to a "pure" plain text view.

@maks
Copy link
Author

maks commented Jan 31, 2022

Thanks for being open to getting Maily working on desktop linux and the research on all the alternatives! I must admit I had not even gotten that far myself. I'll start looking though them to see if one can be a viable workaround pending actual webview support becoming available on Flutter Linux.

Another possible alternative I just thought off is flutter_widget_from_html.

Also its very cool how you've used the webview for editing as well, very neat solution! I'm one of those who sets my mail format to default ot plain text, so for me a TextField would be enough, though there are Flutter widget packages for doing RTE too or I've always wondered about having a markdown mode for sending html mail too that I may look into.

I'll do some more R&D on this and report back - thank you again for being open to include this! 👍🏻

@maks
Copy link
Author

maks commented Feb 1, 2022

Hmm, so after a quick look, it seems both desktop_webview_window and webview_dart both only allow for showing a webview in a separate native window so won't do exactly for the use Maily app needs directly but may in part...

I did a quick spike to try using flutter_widget_from_html and while it can't cope with more complex content, it is able to handle simple html emails (see below).

So that at least is a start, I'll try to set aside sometime soon to look into this in more detail and see if I can manage a not too invasive PR that uses this pkg and then uses one of the above 2 webview-in-a-window packages to optionally display more complex email content in a separate window - somewhat like the way the GMail webapp provides a link at the bottom of some larger html emails: [Message clipped] View entire message
to display the full content in new tab/window.

Here is a screenshot of an example with simpler html content from github notification emails:

Screenshot from 2022-02-01 12-06-50

@robert-virkus
Copy link
Member

Thanks again for your work and for sharing your cool progress! With the above mentioned plain text option selected, Maily selects the text editor by default when composing messages, so this could be an intermediate step.

I already use flutter_widget_from_html_core to render signatures in settings. I guess having some web rendering support is better than none, so I am very much looking forward to your PR (I guess on enough_mail_flutter ).

Then of course some other things need to be handled like a desktop centric UI, etc. But this can be done in pure Flutter once there is an intermediate solution for reading and writing mail.

@maks
Copy link
Author

maks commented Feb 1, 2022

@robert-virkus

Oh! sorry about that, I didnt realise that, as I hadn't spotted it as in this packages pubspec.

And yes I made my quick hack changes in lib/src/mime_message_viewer.dart in enough_mail_flutter so would you prefer that I open an issue in that repo for this proposed change?

@maks
Copy link
Author

maks commented Feb 1, 2022

And yes once the immediate issue with email display/editing are sorted out it would be great to do some UI enhancements for to work better on desktop such as perhaps a classic 2 pane view, maybe using a navigation rail, etc. But as you say those are all just Flutter widgets so much easier to deal with than plugins and platform views.

I've also run into a strange issue with exceptions being thrown due to widget lifecycle and popups but I haven't had a chance to debug it properly - should that kind of issue be filed here or in enough_mail_flutter repo?

@robert-virkus
Copy link
Member

No need to open an additional issue on the enough_mail_flutter repo. In regards to widget lifecycle and popups problems, please report them here.
Please note that I did some improvement and cleanup work in enough_mail_flutter yesterday including in mime_message_viewer.dart, in doubt call git pull origin.

@onny
Copy link

onny commented Dec 27, 2024

Would you mind creating a PR or adding initial Linux support to the project?

I only get the example flutter app demo when trying to execute "flutter run" on Linux

@maks
Copy link
Author

maks commented Dec 30, 2024

@onny sorry I didnt keep my quick fixes to get it running on Linux :-( but looks like you already have Linux support working in your fork 👍🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
desktop Support for desktops (Linux, MacOS, Windows)
Projects
None yet
Development

No branches or pull requests

3 participants