-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parvatijay2901/update signup_and_login_botton_color #130
Parvatijay2901/update signup_and_login_botton_color #130
Conversation
errorMessage: errorMessage ?? this.errorMessage, | ||
showPassword: showPassword ?? this.showPassword, | ||
); | ||
} | ||
|
||
// Check if all fields are filled | ||
bool checkAllFieldsFilled() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check is more of a business logic and I think it is best practice to place this within the cubit instead of the state. The logic would be that this check should run against the current state. You'd need some sort of event that emits a change in this isAllFieldsFilled
.
- You can use a bloclistener (https://bloclibrary.dev/flutter-bloc-concepts/) on the login form / signup form to check what the current state is
- From there you can either modify the state by emitting an event or simply keeping track of just the button state within the widget
* test: setup CI and framework for unit tests * style: update dummy test * test: authService signUp codes tests * test: add build_runner for mocking test classes in CI testing * ci: run workflow only for frontend changes * docs: add description for test group and setup
MultiBlocListener reference: felangel/bloc#3155 |
Added
isAllFieldsFilled
property and acheckAllFieldsFilled
function to theSignupState
andLoginState
classes to make sure the app can check if all the required fields are completed.Further, added a section to check if
isAllFieldsFilled
andisValid
are true => have the login button / signup button as "blue"/primary color, else, by default it is grey.Issue #90