'[ERROR:flutter/lib/ui/ui_dart_state.cc(209) Unhandled Exception: [firebase_auth/unknown Given String is empty or null
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):
Solution 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);
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | plotsklapps |
