This package is used for collecting and sending analytical information from the app to "Firebase".
sl_flutter_firebase_analytics:
git:
url: https://github.com/solutelabs/sl_flutter_firebase_analytics
ref: dev
Analytics().init(
isEnabled: true, // set value to false for disable 'Analytics'
);
MaterialApp(
navigatorObservers: Analytics().observer == null
? []
: [Analytics().observer],
);
Analytics().logAppOpened();
Analytics().setCurrentScreen(screenName: "<CURRENT_SCREEN_NAME_HERE>");
Analytics().setIgnoredRoutes([
'IGNORED_SCREEN_NAME_1',
'IGNORED_SCREEN_NAME_2',
'.....................',
'IGNORED_SCREEN_NAME_N'
]);
Analytics().logLoginEvent(userId: "<USER_ID_HERE", deviceToken: "<FIREBASE_TOKEN_HERE>",);
Analytics().logLogoutEvent();
Analytics().logToFirebase(
name: "<EVENT_NAME_HERE>",
params: <String, dynamic>{'PARAM_1': 'VALUE_1',
'PARAM_1': 'VALUE_1',
'.......': '.......',
'PARAM_N': 'VALUE_N'},
);