Drew Cain
 · FlutterFlow Top 1% User

Add support for Sentry (web) via main.dart

Custom Code

I would like to use Sentry in my application, but support for web is broken because the Sentry.init function requires an appRunner delegate in order to work.

Example:

await SentryFlutter.init(
(options) {
options.dsn = mydsn;
options.tracesSampleRate = 1.0;
options.profilesSampleRate = 1.0;
},
appRunner: () => runApp(MyApp()),
);

What have you tried so far?

I implemented it according to the steps in this Medium article, which works on mobile, but not on web:

https://medium.com/@thuanlegit/flutter-web-with-sentry-392a7b1a0ebf

Again, Sentry for mobile works. Sentry for web works when initialized correctly (testing locally). Sentry for FlutterFlow web does not work because it must be initialized according to the Sentry documentation, which is not currently possible.

Did you check FlutterFlow's Documentation for this topic?
Yes
2
2 replies