diff --git a/website/docs/guides/how-to/stack-trace.md b/website/docs/guides/how-to/stack-trace.md index 70a88c20a1..e2e3180cf4 100644 --- a/website/docs/guides/how-to/stack-trace.md +++ b/website/docs/guides/how-to/stack-trace.md @@ -20,3 +20,17 @@ The standard Rust does not provide stack traces when catching a panic. If you want to know the stack traces, you can use approaches like https://stackoverflow.com/questions/69593235/how-to-get-panic-information-i-e-stack-trace-with-catch-unwind. The builtin utils do use it. + +## Other solutions + +There are many products to help you capture errors and provide a central panel to look at them. +[This official Flutter page](https://docs.flutter.dev/cookbook/maintenance/error-reporting) +lists some of them: Bugsnag, Datadog, Firebase Crashlytics, Rollbar, or Sentry. +This will be especially useful for your app in production. + +## Behavior on Windows + +It seems that Rust+Windows(+Flutter) does not handle stack traces well, +which is not a bug of flutter_rust_bridge, but something on upstream. + +The current discussions and workarounds are in https://github.com/fzyzcjy/flutter_rust_bridge/issues/2200. diff --git a/website/docs/guides/misc-features/rust-ui-utilities.md b/website/docs/guides/misc-features/rust-ui-utilities.md new file mode 100644 index 0000000000..16883422aa --- /dev/null +++ b/website/docs/guides/misc-features/rust-ui-utilities.md @@ -0,0 +1,19 @@ +# Rust-GUI-via-Flutter Utilities + +If you want to use Flutter as GUI of Rust, +please refer to the article in https://cjycode.com/posts/rust-ui-flutter/, +which contains background, pros, cons, tutorial, examples, etc. + +Firstly, this is just one of the infinitely many approaches to let Flutter be the GUI of Rust, +and you are free to choose whatever other approaches that suits your need. + +In that article, the `#[frb(ui_state)]` and `#[frb(ui_mutation)]` lightweight attributes are utilized. +They are not stabilized, i.e. can have breaking changes without major version bumping. +More details are as follows: + +* `#[frb(ui_state)]`: Annotate on your state struct. +* `#[frb(ui_mutation)]`: Annotate on state methods that mutates the state. It can also be annotated on the `impl` block, + which is equivalent to annotate on each method in that block. + +Then, whenever a method with `#[frb(ui_mutation)]` is called, +the Flutter UI will know the state is changed and needs to automatically refresh the UI. diff --git a/website/sidebars.js b/website/sidebars.js index 1070b3e683..df5f2d4df7 100644 --- a/website/sidebars.js +++ b/website/sidebars.js @@ -341,6 +341,7 @@ const sidebars = { items: [ 'guides/misc-features/dart-code', 'guides/misc-features/preambles', + 'guides/misc-features/rust-ui-utilities', 'guides/misc-features/proxy', 'guides/misc-features/multi-input', 'guides/misc-features/modules',