Git Product home page Git Product logo

Comments (11)

stuartmorgan avatar stuartmorgan commented on April 28, 2024 5

using platform channels right?

Yes. On macOS, the APIs are almost identical to the iOS versions. (A couple of classes still have the FLE prefix, and will change in the future; that will be a breaking change, but one easy to update plugins for.)

Is there any way to publish the desktop plugins?

There's no tooling for automatically managing desktop plugins yet, so you can make them available however you like. Anyone using them at this point will need to manage building, including, and linking themselves.

I have a repo of a lot of plugins I made, I would love to add desktop support for them.

There are currently APIs for all three desktop platforms, so you could do that any time you want. Be aware that there are no guarantees about the stability of those APIs though, so you may need to change or rewrite anything you do now. (In practice, you can consider the macOS APIs that have the Flutter prefix, which is almost everything for plugins, to be stable. Linux and/or Windows APIs could change, possibly including a complete rewrite.)

Dart Pub shows Flutter and Web, do you think it will show desktop too?

There are a lot of open questions about how plugin management will work given a much larger set of possible platforms; I would imagine that some kind of discovery system that takes that added complexity into account would need to be part of that.

from flutter-desktop-embedding.

stuartmorgan avatar stuartmorgan commented on April 28, 2024 1

I need to open a different window that runs a webview.

This seems like a pretty specific use case (as opposed to doing an inline webview); it's not clear to me this would be sufficiently general-purpose to add to this repository. I'd suggest hosting it separately, and if there's sufficient interest we could look at folding it into this repo. (Although long-term, I expect more federation, not less, with a model matching that used by mobile Flutter.)

Is there a compelling reason for it being developed in this repository?

If you're not developing it in this repo you can build it however you like, but:

i could make a shell call presumable from the Dart side to open the binary

That gives you a new application, not a new window. Those are fundamentally different.

due to zserge having a cpp base language to call

That API appears to be designed for making self-contained applications; it appears to be very poorly suited to showing a window within the context of an application that's doing other things. Going from a platform-specific plugin API to a thin cross-platform wrapper that appears to have the wrong abstraction for your use case which in turn immediately splits back into platform-specific code internally seems strictly worse that doing what you want to do directly using the platform APIs.

from flutter-desktop-embedding.

stuartmorgan avatar stuartmorgan commented on April 28, 2024 1

If you want it in a new window as requested in this issue, yes: write the platform-specific code to do so as you would in any other native application (e.g., on macOS, create a new NSWindow containing a WKWebView), and then call that code from a plugin.

(Embedding native views within the Flutter view, on the other hand, is currently not possible with the Flutter embedding API.)

from flutter-desktop-embedding.

stuartmorgan avatar stuartmorgan commented on April 28, 2024 1

For example if we want to use google maps in flutter on the desktop would we need to get the embeed views working first on MacOS?

That's correct. That reminded me that I never filed the bugs for those, although it's certainly something that's been on the radar. I've just filed flutter/flutter#31712, flutter/flutter#31713, and flutter/flutter#31714 for tracking.

for a temporary solution we can still open urls with a urlLauncher right?

I assume you mean the url_launcher plugin? You'd need to write the native side locally, which would be straightforward if you are familiar with writing plugins (or wait for it to be written, which will likely be fairly soon since it's an obvious starting point for experimenting with what the plugin infrastructure will look like on desktop, and the plugin API is much more stable than it used to be.)

from flutter-desktop-embedding.

stuartmorgan avatar stuartmorgan commented on April 28, 2024

Is there a compelling reason for it being developed in this repository?

Absent an answer to this question, closing.

from flutter-desktop-embedding.

 avatar commented on April 28, 2024

@stuartmorgan sorry missed this issue

thanks for the comment. It helped me alot to what a better way to approach it.
For now i am going to leave this as its way beyond me i have to admit

from flutter-desktop-embedding.

Anrock avatar Anrock commented on April 28, 2024

So is it possible to open a webview in desktop flutter somehow?

from flutter-desktop-embedding.

rodydavis avatar rodydavis commented on April 28, 2024

@stuartmorgan is this still the case? For example if we want to use google maps in flutter on the desktop would we need to get the embeed views working first on MacOS? for a temporary solution we can still open urls with a urlLauncher right?

from flutter-desktop-embedding.

rodydavis avatar rodydavis commented on April 28, 2024

Ok I don’t mind writing the plugin side, using platform channels right?

Is there any way to publish the desktop plugins?

I have a repo of a lot of plugins I made, I would love to add desktop support for them.

Dart Pub shows Flutter and Web, do you think it will show desktop too?

from flutter-desktop-embedding.

AJ-song avatar AJ-song commented on April 28, 2024

Hello, is it possible to embed NSViews view in Flutter view now? I need to embed a WKWebView to display the web, is there a good solution at present?

from flutter-desktop-embedding.

stuartmorgan avatar stuartmorgan commented on April 28, 2024

Webview support requests are tracked in the Flutter repository:
https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+webview_flutter+label%3A%22a%3A+desktop%22

from flutter-desktop-embedding.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.