Skip to main content

Black Friday 2025! Only until December 1st: coupon FRIDAY25 for 40% off Yearly/Lifetime membership!

Read more here

Adding Registration Functionality with API Usage

Premium
10 min read

In this lesson, we will focus on adding a registration process. This includes a few things:

  • Creating a Home Screen
  • Creating a Registration API function
  • Adding Registration Fields to the UI
  • Creating an Auth Provider to handle authentication management
  • Modifying our main.dart file to react to the authentication state

Here's how the registration screen will look like at the end:


Creating Home Screen

Let's start by creating a Home screen...

The Full Lesson is Only for Premium Members

Want to access all of our courses? (29 h 14 min)

You also get:

54 courses
Premium tutorials
Access to repositories
Private Discord
Get Premium for $129/year or $29/month

Already a member? Login here

Comments & Discussion

LA
Luis Antonio Parrado ✓ Link copied!

Modifications in lib/main.dart doesn't match with commit. It's missing the part when we apply AuthProvider and redirect to new route home.

M
Modestas ✓ Link copied!

Thank you for letting me know! I've updated the code to be correct

MK
Matthew Kille ✓ Link copied!

Hmm, still not corrected?

M
Modestas ✓ Link copied!

Which part exactly? i might have them fixed a different similar issue.

M
Modestas ✓ Link copied!

Please check after this update if it is correct (It should be, but just in case). Thank you :)

MK
Matthew Kille ✓ Link copied!

That's better, but misses the deletion of "home: Login()," from the MaterialApp widget. And the addition of "'/': (context) {" a couple lines below.

Feels to me like we're actually missing a whole section of explanation for this part. The description above it only says we will wrap the code in a provider; which is exactly what the diffs showed previously. And then there could have done with an explanation of what that does and how it is used, i.e. these latest changes. Given the excellent commentary thus far, it seems to be missing something here?

M
Modestas ✓ Link copied!

Okay, now I understand the pain point fully - thank you!

I will update the lesson in a day to better explain what happened and adjust the changes carefully (even now I see that torchlight left some // on the screen).

Sorry about that

M
Modestas ✓ Link copied!

Updated the lesson and added a basic explanation on what we did. Let me know if this helps or should I reword it/explain better!