0

i am trying to create a login sign up with firebase i can sign up and data comes firestore but when i try to login with same user i cant login what can i do can someone help me

E/flutter (20570): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: [firebase_auth/unknown] Given String is empty or null E/flutter (20570): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:607:7) E/flutter (20570): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:177:18) E/flutter (20570): E/flutter (20570): #2 MethodChannel.invokeMapMethod (package:flutter/src/services/platform_channel.dart:377:43) E/flutter (20570): E/flutter (20570): #3 MethodChannelFirebaseAuth.signInWithEmailAndPassword (package:firebase_auth_platform_interface/src/method_channel/method_channel_firebase_auth.dart:474:12) E/flutter (20570): E/flutter (20570): #4 FirebaseAuth.signInWithEmailAndPassword (package:firebase_auth/src/firebase_auth.dart:550:7) E/flutter (20570): E/flutter (20570): #5 AuthService.signIn (package:untitled4/auth.dart:10:16) E/flutter (20570): E/flutter (20570):

1
  • Please provide enough code so others can better understand or reproduce the problem. Commented Apr 10, 2022 at 14:17

1 Answer 1

1

FirebaseAuth.signInWithEmailAndPassword() requires two parameters, String email and String password. I think Flutter is telling you one of these is empty when you call the method. Make sure the parameters are set via the TextEditingControllers().

TextField(
  controller: emailCtrl,
),
TextField(
  controller: passwordCtrl,
),
FirebaseAuth.signInWithEmailAndPassword(emailCtrl.text, passwordCtrl.text);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.