flet-dev / flet

Flet enables developers to easily build realtime web, mobile and desktop apps in Python. No frontend experience required.
https://flet.dev
Apache License 2.0
10.85k stars 417 forks source link

`WebView` control - web and desktop support #432

Open FeodorFitsner opened 1 year ago

FeodorFitsner commented 1 year ago

Web, iOS, Android: https://pub.dev/packages/webviewx Windows: https://pub.dev/packages/webview_windows macOS: https://github.com/akaboshinit/flutter_inline_webview_macos

https://github.com/flutter/flutter/issues/99597

clstaudt commented 1 year ago

Is WebView a way to display HTML-based plots and graphics (e.g. made with plot.ly, altair, ...), and integrate them nicely into the app layout?

FeodorFitsner commented 1 year ago

It can be used for that, yes.

clstaudt commented 1 year ago

That's great to hear. Could we get an estimate of when to expect this feature? For my project, I need to put GUI development on hold until flet supports plotting in some way, or reconsider the GUI framework. I believe support for displaying the output of established plotting libraries would be the best option.

FeodorFitsner commented 1 year ago

What kind of charts are you looking the most?

clstaudt commented 1 year ago

Nothing out of the ordinary: (Stacked) bar charts, line charts (time series), pie charts.... Ideally I want to reuse the charts I have already implemented with https://altair-viz.github.io in a flet app. We want to write apps in Python also because we want to use all the great data libraries.

ndonkoHenri commented 1 year ago

https://github.com/rodydavis/easy_web_view

gbrandt commented 1 year ago

Any ETA on this item? I need to display a Privacy Policy held on our main website in the Flet App (web only, so an iFrame is all I really need). I don't have the bandwidth to help with coding, but I can help with testing.

adampiskorski commented 1 year ago

I would also suggest considering https://pub.dev/packages/flutter_widget_from_html, as it's fully cross platform, still supported and provides features such as video playback, which flet still does not support and is much more difficult to support in a fully cross-platform way (assuming this plugin is fully cross-platform with video). There is also a core version, where you can only add the features you need, such as omitting audio support, as flet already supports that.

iotgopher commented 1 year ago

+1 on this feature - webview opens a lot of possibilities

Stokerx commented 1 year ago

Currently my team and I are thinking about using flet to create a desktop application but my question is if it supports webview to be able to implement it in the project?

FeodorFitsner commented 1 year ago

@Stokerx Thanks for your interest! As you see from this issue doing WebView for Android and iOS would be a breeze, however, AFAIK there is no a unified WebView solution for desktops. What is your use case/requirements for WebView?

Stokerx commented 1 year ago

@FeodorFitsner In this case it would be used to access a verification page of the government's Single Taxpayer Registry, since there is no public Api that can do that verification work, so the idea was to open that web page within the application and make the queries there.

FeodorFitsner commented 1 year ago

IMHO, doing that in WebView could be a challenge as you have to ensure government website works in a webview (cookies, redirect URLs, popups they might use for auth, etc.).

An easier and more "natural" approach would be opening auth website in an user-default web browser and then use localhost:<someport> (hosted in a Python app) for callback redirect and "You can now close the window" HTML response.

On Android and iOS external URL is opened in an in-app window which looks kind of nice.

gbrandt commented 1 year ago

Web view is a requirement to use external chat support such as chatwoot. How hard is we view in browsers?

FeodorFitsner commented 1 year ago

Making "good" WebViews for desktop on macOS, Windows and Linux is potentially the same amount of work and overcoming the same challenges as done by Tauri project. I could be wrong though, but it's just a feeling.

Xynonners commented 1 year ago

also hoping for this function, as I was planning to write a wrapper UI embedding another codebase/UI (communicate over API) into it.

ndonkoHenri commented 9 months ago

https://flet.dev/docs/controls/webview

icsos commented 9 months ago

Hello, May I ask when the desktop and browser versions of webview will be available? I am really looking forward to its use.

FeodorFitsner commented 9 months ago

Web WebView should be easy. macOS would be relatively easy too. Windows is kind of limited (found this https://pub.dev/packages/desktop_webview_window) - looks like it opens a new window with webview - it cannot render the page inside Flutter app.

loafthecomputerphile commented 7 months ago

i have been thinking about this issue and imo wouldn't embedding chromium do the job? it would work with both mac and older versions of windows and is much more backwards compatible. the downside is the increased file size. i found something similar to what i described here: https://pub.dev/packages/webview_cef

icsos commented 4 months ago

Wondering how this control is going...

ndonkoHenri commented 3 weeks ago

Package suggestion: https://pub.dev/packages/webview_all