Learn how to add authentication and navigation to VideoGPTAI
This is the legacy documentation for our original platform, Cades. Our platform has evolved significantly since then to offer both app and website creation capabilities. Find the new documentation here.
Let’s install the social_auth_btn_kit package to add pre-styled authentication buttons for a professional look:
Copy
flutter pub add social_auth_btn_kit
Now prompt the following to add google sign in functionality:
Copy
Create a login page for my app, it should have google sign in for now, add the methods in auth service for google sign inthe login page should have the name of the app in center and then the google sign in button is used from social_auth_btn_kit package add the google sign btn reference<example_auth_button>SocialAuthBtn.facebook( variant: FacebookTypeVariants.outlined, onPressed: () { debugPrint("DEBUG: Facebook Btn Pressed"); }, ),<example_auth_button>
Let’s create a settings page, which will display the user’s profile information and provide a logout option. This page will be accessible from the home screen and give users control over their account settings.
Copy
Create a settings page and link it with the home page and give the logout option and show the current user details in the settings page for now
Using this prompt We were able to migrate the navigation stack of the project, to better manage any redirections for login checks, we want to protect pages that shouldn’t be accessible to user without login
Copy
Integrate go_router package for my app migrate all navigation to go_router
Add a simple redirect logic to the onboarding screen
Copy
In login screen when login is successful you need to go to the onboarding screen