BrixSignupCubit<TSignup, TUser> class
abstract
Cubit for a signup screen, built on brix SignupFlow: email, password and confirm with show / hide and the unmet password rules in the state.
Extend it for the app's own fields and body: keep extra values in your
subclass (for example nameChanged), build the typed body in
buildRequest, and add checks such as accepted terms in beforeSubmit.
Constructors
-
BrixSignupCubit(SignupFlow<
TSignup, TUser> flow)
Properties
-
flow
→ SignupFlow<
TSignup, TUser> -
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isClosed → bool
-
Whether the bloc is closed.
no setterinherited
-
passwordRules
→ List<
PasswordRule> -
Every rule of the policy, in checklist order.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- state → BrixSignupState
-
The current state.
no setterinherited
-
stream
→ Stream<
BrixSignupState> -
The current stream of states.
no setterinherited
Methods
-
addError(
Object error, [StackTrace? stackTrace]) → void -
Reports an
errorwhich triggersonErrorwith an optional StackTrace.inherited -
beforeSubmit(
) → Future< bool> - App checks before the call. Return false to stop (show your own message).
-
buildRequest(
{required String identifier, required String password}) → TSignup -
The app's signup body.
identifieris trimmed; putpasswordin exactly as given. -
close(
) → Future< void> - Closes the instance. This method should be called when the instance is no longer needed. Once close is called, the instance can no longer be used.
-
confirmPasswordChanged(
String value) → void -
emit(
BrixSignupState state) → void -
Updates the
stateto the providedstate.emitdoes nothing if thestatebeing emitted is equal to the currentstate.inherited -
identifierChanged(
String value) → void -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onChange(
Change< BrixSignupState> change) → void -
Called whenever a
changeoccurs with the givenchange. Achangeoccurs when a newstateis emitted.onChangeis called before thestateof thecubitis updated.onChangeis a great spot to add logging/analytics for a specificcubit.inherited -
onError(
Object error, StackTrace stackTrace) → void -
Called whenever an
erroroccurs and notifiesBlocObserver.onError.inherited -
passwordChanged(
String value) → void -
signup(
) → Future< void> - Runs beforeSubmit, then signs up with what is typed. Check the form first.
-
toggleConfirmPasswordVisibility(
) → void -
togglePasswordVisibility(
) → void -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited