Estou tendo esse erro quando tento fazer a requisição de login para o firebase
E/flutter ( 4701): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: type 'List<Object?>' is not a subtype of type 'PigeonUserDetails?' in type cast E/flutter ( 4701): #0 PigeonUserCredential.decode (package:firebase_auth_platform_interface/src/pigeon/messages.pigeon.dart:432:23) E/flutter ( 4701): #1 _FirebaseAuthHostApiCodec.readValueOfType (package:firebase_auth_platform_interface/src/pigeon/messages.pigeon.dart:830:37) E/flutter ( 4701): #2 StandardMessageCodec.readValue (package:flutter/src/services/message_codecs.dart:477:12) E/flutter ( 4701): #3 StandardMessageCodec.readValueOfType (package:flutter/src/services/message_codecs.dart:522:23) E/flutter ( 4701): #4 _FirebaseAuthHostApiCodec.readValueOfType (package:firebase_auth_platform_interface/src/pigeon/messages.pigeon.dart:840:22) E/flutter ( 4701): #5 StandardMessageCodec.readValue (package:flutter/src/services/message_codecs.dart:477:12) E/flutter ( 4701): #6 StandardMessageCodec.decodeMessage (package:flutter/src/services/message_codecs.dart:341:28) E/flutter ( 4701): #7 BasicMessageChannel.send (package:flutter/src/services/platform_channel.dart:218:18) E/flutter ( 4701): E/flutter ( 4701): #8 FirebaseAuthHostApi.signInWithEmailAndPassword (package:firebase_auth_platform_interface/src/pigeon/messages.pigeon.dart:1153:47) E/flutter ( 4701): E/flutter ( 4701): #9 MethodChannelFirebaseAuth.signInWithEmailAndPassword (package:firebase_auth_platform_interface/src/method_channel/method_channel_firebase_auth.dart:343:22) E/flutter ( 4701): E/flutter ( 4701): #10 FirebaseAuth.signInWithEmailAndPassword (package:firebase_auth/src/firebase_auth.dart:580:9) E/flutter ( 4701): E/flutter ( 4701): #11 AuthService.login (package:milkcontrolapp/services/auth_service.dart:13:7) E/flutter ( 4701): E/flutter ( 4701): #12 _LoginPageState.login. (package:milkcontrolapp/pages/login_page.dart:39:106) E/flutter ( 4701): E/flutter ( 4701):
Meu código:
Future<String?> login({required String email, required String password}) async {
try {
await _firebaseAuth.signInWithEmailAndPassword(email: email, password: password);
} on FirebaseAuthException catch (e) {
log(e.code);
switch(e.code){
case 'user-not-found':
return 'O e-mail não está cadastrado';
case 'wrong-password':
return 'Senha incorreta';
case 'invalid-email':
return 'E-mail ou senha incorretos';
case 'too-many-requests':
return 'O acesso à conta foi desativado temporariamente por várias tentativas de login falhas. Tente novamente mais tarde.';
case 'invalid-credential':
return 'E-mail ou senha incorretos';
case 'channel-error':
return 'Os campos de e-mail e senha não podem ser vazios';
}
return e.code;
}
return null;
}