fireship-io / fireship.io

Build and ship your app faster https://fireship.io
3.57k stars 1.31k forks source link

courses/flutter-firebase/auth-login-screen/ #768

Open utterances-bot opened 2 years ago

utterances-bot commented 2 years ago

Login Screen

Build a login screen with Anonymous sign in.

https://fireship.io/courses/flutter-firebase/auth-stream/

SammyTheTurtle commented 2 years ago

I'm not sure if this is the right place for this but I'm having an issue with the course. I have copied the course exactly and followed every step but when I try to use the login button the screen just reloads to the same login page. I'm not sure why this is but it has happened with both anonymous and google sign in, however the anonmous sign in sometimes creates a new account but still only reloads the login page. Any ideas?

PierceF commented 2 years ago

If you ever run into this error lib/login/login.dart:54:35: Error: Required named parameter 'label' must be provided.

Then include label: Text(text), as one of the children of ElevatedButton.icon

eikowagenknecht commented 2 years ago

The imports shown in the video are missing in the snippets.

neebdev commented 2 years ago

This course is not good. That's all I have to say.

benrobbins20 commented 2 years ago

I was getting an error saying AuthService() has no attribute signOut(). I jsut changed it to the function or widget name we defined in auth.dart signOut(), Seems to be working idk

SinaParvaresh commented 2 years ago

Clicking the login button doesn't take me anywhere.

Fimbulg commented 2 years ago

If the issue is that nothing happens when you click the login button make sure your device is correctly connected to the internet. On an emulated device this might be a little iffy so even if the wifi-icon is showing turn it off and on and all that good stuff. Also my first signin was SLOOOOW so you might also just be experiencing a cold start :)

cesnietor commented 2 years ago

In case you have the following error:

Another exception was thrown: type 'Future<void>' is not a subtypeof type '(() => void)?'

Update your login.dart like:

onPressed: (() =>  loginMethod()),

Note: I'm using Flutter 3.3.2