Module 08 Β· Auth & Secure Storage β Lesson 4 of 4 Β· ~11 min
The Auth Screens
One screen, two modes
Login and signup share almost every field β only name and the role picker are signup-only. Rather than two near-duplicate composables, PawWalk ships one AuthScreen with a boolean flag, isSignup, that toggles which fields show and which request fires. You've seen this exact instinct before with UiState in Module 2: model the difference, share everything else.
The screen's local state is a handful of remember { mutableStateOf(...) } fields you met in Module 5 β email, password, name, role, plus a validationError. It reaches its AuthViewModel the same way WalkersScreen reaches its view model: viewModel: AuthViewModel = viewModel() as a default parameter.