SignUpScreenData
Immutable data class representing the state of the registration form.
This class manages the state of the sign-up form with three validated fields. Each field uses TextFieldData to encapsulate both the field value and validation error messages, providing real-time feedback to users as they fill out the form.
Form validation is performed in SignUpViewModel methods (SignUpViewModel.updateName, SignUpViewModel.updateEmail, SignUpViewModel.updatePassword) which update the corresponding TextFieldData.errorMessage based on validation rules. Initial fields have no errors before validation runs; null error messages alone do not establish valid input.
Usage context:
SignUpScreen observes SignUpViewModel.signUpUiState which wraps this data class
Text field composables bind to SignUpScreenData.name, SignUpScreenData.email, and SignUpScreenData.password with two-way data flow
Error messages from TextFieldData are displayed below each input field
The submit button does not use field errors to control its enabled state
Registration success triggers navigation to home screen via repository flow
Parameters
Name field state with validation for full name format.
Email field state with validation for email format.
Password field state with validation for minimum requirements.
See also
ViewModel that manages this screen data
Data class for text field state with validation
Wrapper providing loading and error state