brix_getx library
GetX wrappers for brix flows. Holds no auth logic, only the Flutter and GetX side (text fields, form key, Rx state, dispose).
Classes
-
AccountProvider<
TUser, TProfileUpdate> -
The backend for a logged-in user's own account: current user, profile,
avatar, password, deletion. Kept apart from
AuthProvider, so an app writes only the parts it has. - AuthCapabilities
- What the backend's auth flow looks like. The flows pick the next screen from this instead of checking which backend is used.
-
AuthCodeEntryFlow<
TUser> - A CodeEntryFlow whose codes come from an AuthProvider (signup code, password reset).
- AuthFeedback
- Shows the auth flows' results in the app's own alert style.
-
AuthFormFlow<
TUser> - A FormFlow talking to an AuthProvider.
- AuthFormState
- State of a form screen (login, forgot password, signup, change password...).
- Opens the app's screens for the auth flows, so brix never knows route names or the navigation library.
-
AuthProvider<
TSignup, TUser> - The backend behind the auth flows. Each app writes one subclass for its backend (REST, Firebase, Supabase, ...).
-
AuthSession<
TUser> - A logged-in user and the tokens the backend gave for them.
-
AuthSessionStore<
TUser> - Where the app keeps the session between launches. Each app writes one subclass on its own storage.
- AuthWarning
- A local problem the flows report before any backend call, with a plain English message the app can show as it is.
- AvatarUpload
-
A picture for
AccountProvider.uploadAvatar: a file path (mobile) or the bytes (web, memory), plus its name and type. -
BrixAuthFormController<
F extends FormFlow> - Base GetX controller for a brix auth form: formKey, isSubmitting mirrored from the flow, and the flow disposed with the controller.
- BrixChangePasswordController
- GetX controller for a change password screen, built on brix ChangePasswordFlow: current, new and confirm fields with show / hide and a live checklist for the new password.
-
BrixCodeEntryController<
F extends CodeEntryFlow> - Base GetX controller for a screen with code boxes (signup code, password reset): the boxes, the flow's state as Rx, resend, boxes cleared on a rejected code, and everything disposed on close.
- BrixDeleteAccountController
-
GetX controller for a delete account screen, built on brix
DeleteAccountFlow. Code mode: requestDeletion sends the code (show
the boxes once
isCodeSent), confirm deletes; no auto submit for a destructive action. Other modes: deleteWithoutCode. -
BrixFlow<
S> -
Base of every brix flow: holds one immutable state
Sand tells listeners when it changes. - BrixForgotPasswordController
-
GetX controller for a "forgot password" screen, built on brix
ForgotPasswordFlow. Bind
formKeyand identifierController, showisSubmittingon the button and call submit. - BrixLogger
- A readable console log for apps, one box per message, so lines that come one after another never run together:
-
BrixLoginController<
TUser> - GetX controller for a login screen, built on brix LoginFlow.
-
BrixOtpController<
TUser> - GetX controller for the signup code screen, built on brix OtpVerificationFlow. The last digit submits on its own; a rejected code clears the boxes.
-
BrixProfileController<
TUser, TProfileUpdate> - GetX controller for a profile screen, built on brix ProfileFlow.
- BrixResetPasswordController
- GetX controller for the "new password" screen, built on brix ResetPasswordFlow: code boxes, a new password with a live rules checklist, resend countdown and "change email". Opened without an email, it goes back to login.
-
BrixSessionController<
TUser> - GetX controller for the session actions, built on brix SessionFlow: start on the splash screen, logout from a logout button (show isLoggingOut on it). The flow is disposed with the controller.
-
BrixSignupController<
TSignup, TUser> - GetX controller for a signup screen, built on brix SignupFlow.
- ChangePasswordFlow
- The change password screen of a logged-in user. The user stays logged in on this device; ending other sessions is the backend's job.
- CodeEntryFlow
-
Base of the code screens: one submit at a time, a rejected code counted
in CodeEntryState.failedAttempts, "resend" after a
ResendCooldown, and the countdown stopped on dispose. Subclasses say how long a code is, how a code is sent and how errors map. - CodeEntryState
- State of a screen where the user types an emailed code (signup code, password reset).
- DeleteAccountFlow
- Deleting the logged-in user's account, as the backend's AccountDeletionMode says. On success everything the store keeps is cleared ("remember me" too, the account is gone) and login opens.
-
Failed<
T> - The call did not work; failure says why.
- Failure
- Why something did not work. Every block (auth, network, account, ...) reports problems with these classes instead of plain strings, so an app can react to the kind of problem, not only show a text.
- ForgotPasswordFlow
- The "forgot password" screen: asks the backend to send a reset code or link, then moves on as AuthCapabilities.resetMode says.
- FormFlow
- Base of the form flows: one call at a time, busy state while it runs, and thrown errors shown as a failure instead of crashing.
- Json
- A safe way to read decoded JSON (from any backend: REST, Firebase, Supabase, ...) into your own models.
-
LoginFlow<
TUser> - Everything the login screen does, without any UI or state library.
- NetworkFailure
- No connection or the request timed out.
- OtpCodeBoxes
- The text fields of a code entered one digit per box. Used by every code screen controller, so typing, paste and clearing behave the same.
- OtpPurpose
- Why a one-time code was sent.
-
OtpVerificationFlow<
TUser> - The code screen after signup: verify the emailed code, ask for a new one after a cooldown, or go back to change the email.
- PasswordPolicy
- What a new password must contain (signup, reset, change password).
- PasswordRule
- One requirement of a PasswordPolicy, for a live checklist on screen.
- PasswordRulesTracker
- Keeps unmet in sync with what is typed in field, for a live checklist under a new password field.
-
ProfileFlow<
TUser, TProfileUpdate> - The logged-in user's profile: load, save the app's typed update, new avatar. After a save or an avatar the user is reloaded, and the saved session gets the fresh user.
-
ProfileState<
TUser> - State of the profile screen.
- RememberedCredentials
- Login details kept for "remember me".
- ResetPasswordFlow
- The "new password" screen of ResetMode.otp: the emailed code plus a new password, a new code after a cooldown, or back to change the email.
-
Result<
T> - Outcome of any brix call: Success or Failed, nothing else.
- ServerFailure
- The server failed or answered with an unexpected status.
-
SessionFlow<
TUser> - Starts and ends the user's session: what opens when the app starts, and logout.
- SessionState
- State of the session actions.
-
SignupFlow<
TSignup, TUser> -
The signup screen. The app builds its own typed body (
TSignup); the flow checks the password, sends it once, then opens the code screen (when the backend sends one) or login. -
Success<
T> -
The call worked. For calls without data use
Success<void>(null). - Not logged in or the session ended (HTTP 401).
- UnknownFailure
- Anything else. cause keeps the original error for logging; it is never meant to be shown to the user.
- UnsupportedFailure
- The backend does not offer this call (e.g. OTP on a link-only backend).
- ValidationFailure
- The input was rejected (HTTP 400 / 422, form rules on the server).
Enums
- AccountDeletionMode
- How the backend confirms that the user really wants their account gone.
- LogLevel
- How important a log line is. Lines below BrixLogger.minLevel are skipped.
- ResetMode
- How a backend lets the user set a new password.
Functions
-
failureFromError(
Object error, StackTrace stackTrace) → Failure - Default way to turn a thrown error into a Failure.
-
maskIdentifier(
String identifier) → String - Hides most of an email or phone number for display, e.g. on the code screen ("code sent to ru•••@gmail.com").