Comments (4)
So it could be something like this
and this is how it would be used:
https://github.com/nativeshell/examples/blob/nativeshell_plugin/src/file_open_dialog.rs
https://github.com/nativeshell/examples/blob/nativeshell_plugin/src/platform_channels.rs
https://github.com/nativeshell/examples/blob/nativeshell_plugin/src/main.rs
from nativeshell.
Have you taken look at the examples? There are rust channel handlers registered with message manager.
https://github.com/nativeshell/examples/blob/main/src/platform_channels.rs
https://github.com/nativeshell/examples/blob/main/src/file_open_dialog.rs
If you want to you can even package your handler as a crate, all you'd need as an entry point is for your plugin to register with message manager.
from nativeshell.
Yeah I've seen the examples. But if you compare the api to the flutter-rs api it's way more cumbersome to work with.
In flutter-rs all you need to do is implement the trait MethodCallHandler
and then you can register it with the engine.
There is also a Plugin
trait which allows registration of channels to the engine.
For reference here you can find the usage of the Plugin
trait and here you can see how the usage of the MethodCallHandler
trait looks like.
from nativeshell.
I see. Would something like this work?
https://gist.github.com/knopp/139f7b2b02ce4f59e2649bc1560276c3
The Plugin
struct is fairly easy to implement on top of existing machinery, but I don't mind including it if it makes things more convenient.
from nativeshell.
Related Issues (20)
- Crashes on multiple monitors in Windows HOT 4
- Is there any way to lower the minimum supported version of macOS HOT 1
- way to run existing flutter code HOT 4
- How to specify libflutter location
- Frameless windows are not resizable on macOS
- Fails to build on apple silicon with Flutter 3.0.0 HOT 2
- The Flutter Attach to Process gets stuck on Waiting... HOT 3
- Invalid read causes segmentation fault HOT 3
- std::rc::Weak<ContextImpl>` cannot be sent between threads safely
- std::rc::Weak<ContextImpl>` cannot be sent between threads safely
- MenuItem clash with flutter widget of the same name HOT 1
- Getting an error when trying to run the examples HOT 2
- Build Error on MacOS 13.2.1 - cargo run or cargo run --release unable to build and run the flutter app for example provided
- Issues with native plugin `media_kit` HOT 2
- Latest SharedPreferences not working HOT 1
- Jitter when resizing on Windows when frame is `WindowFrame.noTitle` HOT 1
- Unable to build sample project HOT 2
- [super_context_menu] Change/Remove Progress Indicator for DeferredMenuElement
- Calling dart from rust side?
- Support current stable version of Flutter
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nativeshell.