0

I am new to flutter programming. I want to create a flutter web app which can be run in web view in a Flutter desktop application for all desktop platforms (Linux, Windows and MacOS). The web-app will be running on the main thread. And desktop specific tasks will be run on an isolate. The web app will be the UI and would mainly be using cloud firestore and mostly be listening to document or collection changes and communicate the changed data back to the isolate.

Is the web-app on a Flutter Desktop application possible to do ? And will I be needing to "hosting" the web page to used in a web_view ?

And will I be able to communicate with the web-app from the isolate with the usual Isolate communications ?

1 Answers1

1

I want to create a flutter web app which can be run in web view in a Flutter desktop application for all desktop platforms

Currently Flutter doesn't have desktop support for platform views, which means you can't have an inline webview. You could use a full-window webview with no Flutter UI, but then it's not clear what value you would get from having the desktop host be a Flutter application.

And will I be able to communicate with the web-app from the isolate with the usual Isolate communications ?

If you are expecting to be able to communicate directly between the isolate of the Flutter desktop host and the Flutter web application, no. You would be subject to all of the standard limitations of using a webview, which means any communication in or out would have to go through JavaScript. The fact that the host app is a Flutter app would be essentially invisible to the web app, and similarly in the other direction, because you would be running two completely unrelated instances of the Flutter engine and Dart VM (one compiled to native code and one compiled to JS).

smorgan
  • 20,228
  • 3
  • 47
  • 55
  • Hi Thanks for your answer. The Flutter Application is for all platforms including Android and Ios. I have completed the android part the application which is dart for the UI and kotlin for all background work. And my application is not really focused on UI, its more about of the background work it does. And most of the time will be run in the background listening to Firebase collections and clipboard changes. I am not comfortable with C and C++ to write native code for desktop applications. So I was thinking of using Flutter Web-app for desktop UI. And isolates for background work. – Iniyan Kanmani Oct 04 '22 at 11:30