Flutter

Firebase Integration

Firebase Auth, Firestore, Cloud Messaging, Analytics, Crashlytics, Remote Config

18 perguntas de entrevistaยท
Mid-Level
1

Which package should be used to initialize Firebase in a Flutter application?

Resposta

The firebase_core package is the fundamental package required to initialize Firebase in Flutter. It must be added as a dependency and Firebase.initializeApp() must be called before using any other Firebase service. All other Firebase packages (firebase_auth, cloud_firestore, etc.) depend on firebase_core.

2

Where should Firebase.initializeApp() be called in a Flutter application?

Resposta

Firebase.initializeApp() must be called in the main() function before runApp(), with WidgetsFlutterBinding.ensureInitialized() to ensure Flutter bindings are ready. This async initialization is necessary because Firebase performs native operations that require the Flutter framework to be fully initialized.

3

Which Firebase Auth method allows listening to authentication state changes in real-time?

Resposta

authStateChanges() returns a Stream<User?> that emits events whenever the authentication state changes (sign in, sign out, token refresh). This is the recommended method to handle authentication state reactively in the app, allowing automatic UI updates.

4

How to create a new user with email and password in Firebase Auth?

5

What is the difference between authStateChanges() and idTokenChanges() in Firebase Auth?

+15 perguntas de entrevista

Domine Flutter para sua proxima entrevista

Acesse todas as perguntas, flashcards, testes tecnicos, exercicios de code review e simuladores de entrevista.

Comece gratis