Relative Content

Tag Archive for flutterfirebasedartfirebase-authentication

Firebase authChanges triggering twice

class MyApp extends StatefulWidget { const MyApp({super.key}); @override State<MyApp> createState() => _MyAppState(); } class _MyAppState extends State<MyApp> { late Stream<fb_auth.User?> authChanges; @override void initState() { authChanges = fb_auth.FirebaseAuth.instance.authStateChanges(); super.initState(); } @override Widget build(BuildContext context) { return GestureDetector( onTap: () { FocusScopeNode currentFocus = FocusScope.of(context); if (!currentFocus.hasPrimaryFocus && currentFocus.focusedChild != null) { FocusManager.instance.primaryFocus!.unfocus(); } }, child: […]

Using FirebaseAuth stateChanges to switch pageView index

I am trying to write an app and I have a section to display the users profile and a login/register prompt if they aren’t signed in yet. I am using a pageView to switch between the 2 as I want to keep the profile page alive at all times so I don’t need to keep making requests for data each time I open it. The section itself is in another pageView with a map widget I made that I also always want to keep alive at all times:

When I test the app, it says both mail and password are incorrect, even though I only entered the mail part incorrectly

class LoginScreen extends StatefulWidget { const LoginScreen({super.key}); @override State<LoginScreen> createState() => _LoginScreenState(); } class _LoginScreenState extends State<LoginScreen> { /* — login screen text controllers — */ final emailController = TextEditingController(); final passwordController = TextEditingController(); /* — login screen text controllers — */ /* — login user in method — */ void loginUser() async { try […]

App not authorized Firebase Flutter android

I have a Flutter Android app that uses Firebase Authentication. It was working fine with the old Firebase project. After switching to a new laptop machine to run project on different device I get the following error when trying to send OTP even after adding the SHA-1 and SHA-256 key on firebase for that device: