Available block data
Stores login initialization details likeloginIdentifier
, loginIdentifierError
, emailEnabled
, phoneEnabled
, usernameEnabled
, and primaryLoading
.
Available block methods
navigateToSignup()
: Redirects users to the signup screen.submitLogin({required String loginIdentifier, bool isPhone = false}) async
: Sends the login identifier for authentication.
Implementation Steps
1
Create Login Screen
Create a new screen that implements the
LoginInitBlock
interface. This screen will serve as the entry point for the login process.lib/screens/login_init.dart
2
Set Up Email Controller
Initialize a text controller for the email input field, pre-populated with any existing login identifier from the block data.
lib/screens/login_init.dart
3
Create Email Input Field
Implement a text field for email input with proper autofill hints and styling. This field will capture the user’s email address.
lib/screens/login_init.dart
4
Add Navigation and Action Buttons
Implement the signup navigation button and login submission button with proper loading states and error handling.
For a complete implementation example, see the LoginInitScreen implementation on GitHub.