0
0
Fluttermobile~10 mins

Firebase Authentication in Flutter - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to initialize Firebase in a Flutter app.

Flutter
void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Firebase.[1]();
  runApp(MyApp());
}
Drag options to blanks, or click blank then click option'
AstartApp
BinitFirebase
CinitializeApp
DlaunchApp
Attempts:
3 left
💡 Hint
Common Mistakes
Using a method name that does not exist in Firebase.
Forgetting to call ensureInitialized before Firebase initialization.
2fill in blank
medium

Complete the code to sign in a user with email and password.

Flutter
final userCredential = await FirebaseAuth.instance.[1]('user@example.com', 'password123');
Drag options to blanks, or click blank then click option'
AsignInWithEmailAndPassword
BregisterUser
CloginUser
DauthenticateUser
Attempts:
3 left
💡 Hint
Common Mistakes
Using a method that does not exist in FirebaseAuth.
Confusing sign in with registration methods.
3fill in blank
hard

Fix the error in the code to sign out the current user.

Flutter
await FirebaseAuth.instance.[1]();
Drag options to blanks, or click blank then click option'
AsignIn
Blogout
ClogOutUser
DsignOut
Attempts:
3 left
💡 Hint
Common Mistakes
Using non-existent methods like 'logOutUser' or 'logout'.
Using signIn instead of signOut.
4fill in blank
hard

Fill both blanks to create a new user with email and password.

Flutter
final userCredential = await FirebaseAuth.instance.[1]('[2]', 'mypassword');
Drag options to blanks, or click blank then click option'
AcreateUserWithEmailAndPassword
BsignInWithEmailAndPassword
Cuser@example.com
Dnewuser@example.com
Attempts:
3 left
💡 Hint
Common Mistakes
Using signIn method instead of createUser.
Using an invalid email string.
5fill in blank
hard

Fill all three blanks to send a password reset email.

Flutter
await FirebaseAuth.[1].sendPasswordResetEmail(email: '[2]');

print('[3]');
Drag options to blanks, or click blank then click option'
Ainstance
Buser@example.com
CPassword reset email sent
DcurrentUser
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect FirebaseAuth instance accessor.
Forgetting to provide the email parameter.
Not printing a confirmation message.