Not every pixel problem is a Dart problem. RustDesk keeps capture/encode/networking in Rust and uses Flutter as the interactive shell — a hybrid you should understand before you rewrite a native module in pure Dart.
Split of responsibilities
| Concern | Home |
|---|---|
| Screen capture, codecs, relay | Rust core |
| Connection UX, settings, session UI | Flutter |
| OS integration | Platform channels / FFI |
Steal this
- Draw a hard boundary: hot UI loop vs hot data loop.
- Prefer FFI for throughput; channels for infrequent events.
- Keep session state outside widget trees.
Pitfalls
- Hybrid builds double your CI matrix.
- ABI and packaging for desktop installers are non-trivial.
If your app is UI-heavy, Flutter alone may suffice. If it is pipeline-heavy, copy RustDesk’s boundary, not necessarily Rust itself.
Originally published on FlutterCook. Read the latest version there — that copy is the one kept up to date.
Nhận xét
Đăng nhận xét