--
You received this message because you are subscribed to the Google Groups "Desktop Embedding for Flutter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-desktop-embe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/flutter-desktop-embedding-dev/b019cd41-133c-4f8f-8607-7b3fd96e21ee%40googlegroups.com.
I'm a member of the Ubuntu desktop team and we're currently investigating the use of Flutter for desktop apps.
- D-Bus supportTo integrate with the desktop apps are going to need some sort of D-Bus support. This would probably be done with a native Dart package. We considered wrapping existing libraries but feel that for debugging reasons a native implementation will probably work better.
- Implement Unix Domain SocketsTo support D-Bus and other local services Dart needs support for Unix Domain Sockets [1]. I've made a simple C Dart extension that wraps the appropriate syscalls (socket/connect/read/write) and then has a Dart class that uses these. Ideally this would be proposed into Dart as a number of other people seem to want this. I've come up against two issues:1. It's not clear to me how to make this code asynchronous. Should I:- Be able to register the file descriptor somewhere in Dart and respond in callbacks? I haven't found any code that seems to do this.- Use a Dart isolate to wrap the extension. This seems like code that would be better to avoid if I could do the above.I've been looking at the TCP socket implementation in the Dart VM and haven't worked out the method used there to make it asynchronous. Anyone know?
2. Extension don't seem to load in the Dart that comes with the Flutter SDK [2]. I've tried both the downloaded version and built from the git branch with no luck. If I just use the Dart SDK / git branch they work fine. Is this a bug or are extensions not supposed to work with Flutter?
- Distributing Flutter based apps as snaps [3].We've just started on this and working out how to make this work easily.
Unix socket should be relatively straightforward to wrap with ffi.
We have started to wrap libsodium with ffi without real difficulty, source are here https://github.com/rushio-consulting/libsodium.dart
On Tue, Sep 17, 2019 at 3:08 AM <robert...@canonical.com> wrote:2. Extension don't seem to load in the Dart that comes with the Flutter SDK [2]. I've tried both the downloaded version and built from the git branch with no luck. If I just use the Dart SDK / git branch they work fine. Is this a bug or are extensions not supposed to work with Flutter?Flutter indeed does not support Dart's native extensions. However, Flutter support for dart:ffi just launched as a preview, which will let you accomplish much the same thing. See https://medium.com/dartlang/announcing-dart-2-5-super-charged-development-328822024970 for an overview and links to more details.The more established way of doing this would be with Flutter's platform channels:We have preliminary support for them on Linux (the APIs are not finalized; feedback welcome if you decide to go that route!), and there are a few Linux plugins in the FDE repository that show examples of using them:color_panel does asynchronous callbacks from C++ to Dart, for instance.
- Distributing Flutter based apps as snaps [3].We've just started on this and working out how to make this work easily.I'm not sure if anyone in the community has started looking at this; it's not within the scope of things we've investigated within the project itself. The current state on Linux is that when you build, it creates a self-contained (not including system-level library dependencies) folder, including the executable, the Flutter library, any plugin libraries, and the Flutter resources. If you have questions about the details of that, and/or feedback on ways it could be structured differently to make packaging easier (that structure is not something we've iterated on at all), please let us know!