setCurrentScreen method
Future<void>
setCurrentScreen({
- required String? screenName,
- String screenClassOverride = 'Flutter',
- AnalyticsCallOptions? callOptions,
override
Sets the current screenName
, which specifies the current visual context
in your app.
This helps identify the areas in your app where users spend their time and how they interact with your app.
The class name can optionally be overridden by the screenClassOverride
parameter.
The screenName
and screenClassOverride
remain in effect until the
current Activity
(in Android) or UIViewController
(in iOS) changes or
a new call to setCurrentScreen is made.
Setting a null screenName
clears the current screen name.
See also:
- https://firebase.google.com/docs/reference/android/com/google/firebase/analytics/FirebaseAnalytics.html#setCurrentScreen(android.app.Activity, java.lang.String, java.lang.String)
- https://firebase.google.com/docs/reference/ios/firebaseanalytics/api/reference/Classes/FIRAnalytics#setscreennamescreenclass
Implementation
@override
Future<void> setCurrentScreen({
required String? screenName,
String screenClassOverride = 'Flutter',
AnalyticsCallOptions? callOptions,
}) async {
await _firebaseAnalytics.setCurrentScreen(
screenName: screenName,
screenClassOverride: screenClassOverride,
callOptions: callOptions,
);
}