Ahmed Znouda is the lead developer of Mind Screen. A software developer with more than nine years of experience in IT, he built the Flutter app, its voice pipeline, scoring engine and backend.
The table of what the observer logs versus what it should is the best part. /a, b, c for one screen is the kind of thing nobody notices until a report looks odd.
Two related things that inflate screen counts, in case they're worth a line:
Firebase also logs screen views on its own, per Activity. In a Flutter app that's a MainActivity screen_view on every launch, next to yours. Setting google_analytics_automatic_screen_reporting_enabled to false in the manifest meta-data (and FirebaseAutomaticScreenReportingEnabled to NO in Info.plist) leaves only the listener's views.
And bottom sheets and dialogs: showModalBottomSheet pushes a route without a page, so it isn't in currentConfiguration and the listener won't see it (nor did the observer, with no name). For a paywall or consent sheet, that's often the screen you most want counted. Do you log those by hand with logScreenView, or leave them out on purpose?
One question on redirects: with an auth redirect from /home to /login, does the delegate notify once with the final configuration, or can a /home view slip through first?
Flutter developer. I build SMF, a free open-source CLI that generates Flutter apps from independent modules checked together in CI. I write about what breaks in Flutter builds.
I checked the automatic screen views on an Android 12 emulator and an iPhone simulator with the debug logging of Firebase Analytics. Every cold start logged a screen_view with the screen class MainActivity (FlutterViewController on iOS) and no screen name, right before the listener's own view. On Android there was one more each time the app came back from the background. With the two keys you mentioned, only the listener's view was left. The apps that SMF generates didn't turn them off either. That's fixed in a PR that goes out with the next release, and it credits your comment.
As for sheets and dialogs, I don't log them by hand yet. The router's configuration doesn't change when one opens or closes, so the listener logs nothing, and FirebaseAnalyticsObserver skips them too because by default it only logs a PageRoute. So in SMF the paywall that the onboarding pushes as a route without a page isn't counted. For a screen like that I'd call logScreenView when it's shown.
And on redirects, /home doesn't slip through. go_router runs the redirect while it parses the location, before the delegate gets the new configuration. I checked it on go_router 18.1.1: starting at /home while signed out, the listener only sees /login. Signing in then gives /home once, and signing out /login once.
I've added an update to the post with all three. Thanks again for the comment!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
The table of what the observer logs versus what it should is the best part.
/a,b,cfor one screen is the kind of thing nobody notices until a report looks odd.Two related things that inflate screen counts, in case they're worth a line:
Firebase also logs screen views on its own, per Activity. In a Flutter app that's a
MainActivityscreen_view on every launch, next to yours. Settinggoogle_analytics_automatic_screen_reporting_enabledto false in the manifest meta-data (andFirebaseAutomaticScreenReportingEnabledto NO in Info.plist) leaves only the listener's views.And bottom sheets and dialogs:
showModalBottomSheetpushes a route without a page, so it isn't incurrentConfigurationand the listener won't see it (nor did the observer, with no name). For a paywall or consent sheet, that's often the screen you most want counted. Do you log those by hand withlogScreenView, or leave them out on purpose?One question on redirects: with an auth redirect from
/hometo/login, does the delegate notify once with the final configuration, or can a/homeview slip through first?Thanks, Ahmed, you were right on both.
I checked the automatic screen views on an Android 12 emulator and an iPhone simulator with the debug logging of Firebase Analytics. Every cold start logged a
screen_viewwith the screen classMainActivity(FlutterViewControlleron iOS) and no screen name, right before the listener's own view. On Android there was one more each time the app came back from the background. With the two keys you mentioned, only the listener's view was left. The apps that SMF generates didn't turn them off either. That's fixed in a PR that goes out with the next release, and it credits your comment.As for sheets and dialogs, I don't log them by hand yet. The router's configuration doesn't change when one opens or closes, so the listener logs nothing, and
FirebaseAnalyticsObserverskips them too because by default it only logs aPageRoute. So in SMF the paywall that the onboarding pushes as a route without a page isn't counted. For a screen like that I'd calllogScreenViewwhen it's shown.And on redirects,
/homedoesn't slip through. go_router runs the redirect while it parses the location, before the delegate gets the new configuration. I checked it on go_router 18.1.1: starting at/homewhile signed out, the listener only sees/login. Signing in then gives/homeonce, and signing out/loginonce.I've added an update to the post with all three. Thanks again for the comment!