Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use Get with firebase_Analytics ? #4

Closed
Dangtrungphu opened this issue Dec 15, 2019 · 3 comments
Closed

How to use Get with firebase_Analytics ? #4

Dangtrungphu opened this issue Dec 15, 2019 · 3 comments

Comments

@Dangtrungphu
Copy link

Dangtrungphu commented Dec 15, 2019

How can I add firebase_Analytics to my project using Get?

@jonataslaw
Copy link
Owner

How can I add firebase_Analytics to my project using Get?

I believe there is no problem. Firebase Analytics uses navigatorObservers (a midleware that watches each route navigation), and Get uses a navigatorKey (which inserts Get's navigatorKey in place of the default navigatorKey, allowing currentContext access outside the widgets tree).

If you encounter any problems, you can enter the error log in this issue, but I don't believe there is any problem using both.

@Dangtrungphu
Copy link
Author

Thank you. I am a new frame flutter, I feel this lib is easy for me. so I still don't know how to use it with Firebase Analytics. Can you give me a specific example?

@jonataslaw
Copy link
Owner

FirebaseAnalytics analytics = FirebaseAnalytics();

class MyApp extends StatelessWidget {
@OverRide
Widget build(BuildContext context) {
return MaterialApp(
navigatorKey: Get.key,
home: Home(),
navigatorObservers: [
FirebaseAnalyticsObserver(analytics: analytics),
],
);
}
}
If you have any other questions, or errors, don't hesitate to open another issue.

jonataslaw pushed a commit that referenced this issue Nov 9, 2020
kamazoun added a commit to kamazoundevz/getx that referenced this issue Jan 12, 2021
kamazoun added a commit to kamazoundevz/getx that referenced this issue Jan 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants