DEV Community

Cover image for Simple Login Flow in Flutter, then Firebase - Part One

Simple Login Flow in Flutter, then Firebase - Part One

Aaron K Saunders on May 31, 2019

Simple Firebase Login Flow in Flutter We will create a simple application with the following components Default Main App Entry Point ...
Collapse
 
camillo777 profile image
camillo777

Very nice article!
I think for Part1 you forgot to add at the end to call "Login":

if (form.validate()) {
print("$_email $_password");
Provider.of(context).loginUser(_email, _password); <-----------
}

Collapse
 
aaronksaunders profile image
Aaron K Saunders

thanks for the catch

Collapse
 
hwcjd profile image
hwcjd

Hello Aaron,

Great article!
I want to add on the comment of camillo777.
His comment is correct, however I see that the type <AuthService> has disappeared.
Because of HTML formatting. The correct output should be:
Provider.of<AuthService>(context).loginUser(_email, _password);

Collapse
 
robmagario profile image
RH • Edited

When I ran the code above with the newest version of Provider (4.1.3), I am getting the following error.

Error: A value of type 'AuthService' can't be assigned to a variable of type 'Widget'.

How can I fix this error?

Collapse
 
aaronksaunders profile image
Aaron K Saunders • Edited

take a look at this updated code - github.com/aaronksaunders/flutter_...

Collapse
 
robmagario profile image
RH

Thanks a lot!

Collapse
 
adityakmr7 profile image
Aditya Kumar

How can We register user ??

Collapse
 
aaronksaunders profile image
Aaron K Saunders

here is a complete example with login and user creation - github.com/aaronksaunders/flutter_...

Collapse
 
shiv239 profile image
Shivam Rank

Not able to get User variable!

Collapse
 
katafrakt profile image
Paweł Świątkowski

That's nice! Although I got a little mislead by the title - I was going to skip this post as I don't want Firebase, but this scaffold you've shown here can actually be useful for me anyway.

Collapse
 
aaronksaunders profile image
Aaron K Saunders

glad it worked out for you! Ping me if you have any questions, I have used this flow to integrate with other backends

Collapse
 
apoorv161 profile image
Apoorv Chaudhary

It was quite crisp-concise and relatable content! I had an experience which I'm sharing when I was trying to Hire dedicated developers via referring. Earlier I failed as the cost of hiring experts was high. Then, via my Instagram, I found Eiliana.com. I searched the reviews and testimonials then decided to try. I am glad today I did that as now I have wonderful experts.

Collapse
 
rukudzo1997 profile image
Rukudzo N Gawa

All I see after following this is a blank white screen. Where could I have gone wrong?