You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
final integration = options.integrations.firstWhere(
82
-
(element) => element is WidgetsBindingIntegration);
83
-
options.removeIntegration(integration);
81
+
SentryFlutter.init(
82
+
(options) {
83
+
...
84
+
final integration = options.integrations
85
+
.firstWhere((element) => element is WidgetsBindingIntegration);
86
+
options.removeIntegration(integration);
87
+
},
88
+
// Init your App.
89
+
appRunner: appRunner,
90
+
);
84
91
```
85
92
86
-
### Enable multi-view in the example app
93
+
### Example application using the multi-view feature with the sentry plugin
87
94
88
-
To make the [sentry flutter example app](https://github.com/getsentry/sentry-dart/tree/main/flutter/example)`multi-view` ready, you will need to modify the `main.dart` and create the `multi_view_app.dart` file next to the `main.dart` and insert the content from the [docs](https://docs.flutter.dev/platform-integration/web/embedding-flutter-web#handling-view-changes-from-dart).
89
-
Modify the `index.html`in the `web` directory and add the `flutter_bootstrap.js` file.
95
+
Below is the code for an **example application** using the **multi-view** feature in combination with the **sentry plugin**.
90
96
91
-
Also note the `NavigatorKey` in the `MaterialApp` widget. This key is a single `GlobalKey` in the `example app` and therefore doesn't support multiple instances. If you rely on this `NavigatorKey` you will need to handle multiple `Keys` and pass them to the appropriate view/instance. For simplicity, we will not use the `NavigatorKey` in the following example.
97
+
Copy the `main.dart` into the `lib` folder of your existing project. This file already contains the code of the `multi_view_app.dart` from the [`flutter documentation`](https://docs.flutter.dev/platform-integration/web/embedding-flutter-web#handling-view-changes-from-dart).
98
+
Next, copy the `flutter_bootstrap.js` and the `index.html` into the `web` folder.
92
99
93
-
Now you should be able to see 2 instances of the same application side by side, with different ViewIds in the `AppBar`.
100
+
Make sure you are using **Flutter 3.24** or newer and run the application.
101
+
102
+
Now you should be able to see **2** instances of the same application side by side, with different **ViewIds** in the `body`.
0 commit comments