MagicStarterProfileController class
Profile controller for Magic Starter plugin.
- Inheritance
-
- Object
- ChangeNotifier
- MagicStarterProfileController
Constructors
Properties
- firstError → String?
-
Get the first validation error message.
no setterinherited
- hasErrors → bool
-
Check if there are any validation errors.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- initialized → bool
-
Whether the controller has been initialized.
no setterinherited
- isDisposed → bool
-
Whether the controller has been disposed.
no setterinherited
- isEmailVerified → bool
-
Returns whether the authenticated user's email address has been verified.
no setter
- isEmpty → bool
-
Check if empty (no data).
no setterinherited
- isError → bool
-
Check if an error occurred.
no setterinherited
- isLoading → bool
-
Check if currently loading.
no setterinherited
- isSuccess → bool
-
Check if successfully loaded.
no setterinherited
- isTwoFactorEnabled → bool
-
Whether the authenticated user has two-factor authentication enabled.
no setter
- refusalAction → MagicStarterRefusalAction?
-
What the user can do to clear a refused account deletion, or
nullwhen the last call was not refused that way or nothing in the app can clear it.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- rxState → bool?
-
Get the current state.
no setterinherited
- rxStatus → RxStatus
-
Get the current status.
no setterinherited
-
stepUpAccepts
→ List<
String> ? -
The proofs the server takes after refusing a gated call with
step_up_required(code,confirmation_token), ornullwhen the last call was not refused that way.no setter -
validationErrors
↔ Map<
String, String> -
Current validation errors keyed by field name.
getter/setter pairinherited
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
Authorize an action against the current
Auth.uservia theGate.inherited -
beginSocialConnect(
String provider, {required Map< String, String> proof}) → Future<Future< Map< Function()?>String, dynamic> > -
Starts linking
providerand answers the call that opens it, ornullwhen the bridge refused or the user backed out. -
clearErrors(
) → void - Clear all validation errors.
-
clearFieldError(
String field) → void -
Clear a specific field's validation error.
inherited
-
dispose(
) → void -
Runs
onCloseif it has not run yet, then releases the notifier.inherited -
doConfirmTwoFactor(
{required String code}) → Future< bool> - Confirms two-factor authentication setup with the provided OTP code.
-
doConnectSocialAccount(
Future< Map< opener()) → Future<String, dynamic> >bool> -
Runs the
openerbeginSocialConnect answered, then restores the user. -
doDeleteAccount(
{required Map< String, String> proof, bool immediately = false}) → Future<bool> - Delete user account.
-
doDeleteProfilePhoto(
) → Future< bool> - Delete profile photo.
-
doDisableTwoFactor(
{required Map< String, String> proof}) → Future<bool> - Disables two-factor authentication.
-
doDisconnectSocialAccount(
String provider) → Future< bool> -
Unlinks
providerfrom the signed-in account, then restores the user. -
doEnableTwoFactor(
{required Map< String, String> proof}) → Future<Map< String, dynamic> ?> - Enables two-factor authentication for the current user.
-
doRegenerateRecoveryCodes(
{required Map< String, String> proof}) → Future<List< String> ?> - Regenerates two-factor authentication recovery codes.
-
doRevokeOtherSessions(
{required Map< String, String> proof}) → Future<bool> - Revokes all other browser sessions except the current one.
-
doRevokeSession(
{required String tokenId, required Map< String, String> proof}) → Future<bool> - Revokes a specific browser session by its token ID.
-
doSetPassword(
{required String password, required String passwordConfirmation, required Map< String, String> proof}) → Future<bool> - Sets the first password of an account that signed up through a provider.
-
doUpdatePassword(
{required String currentPassword, required String password, required String passwordConfirmation}) → Future< bool> - Update password.
-
doUpdateProfile(
{required String name, required String email, String? phone, String? timezone, String? language, String? password, String? passwordConfirmation}) → Future< bool> - Update profile information.
-
doUpdateProfilePhoto(
{required MagicFile file}) → Future< bool> - Update profile photo.
-
errorFieldFor(
String wireKey) → String -
Map a raw wire validation key to the form field it should report on.
inherited
-
fetchList<
E> (String url, E fromMap(Map< String, dynamic> ), {String dataKey = 'data', Map<String, dynamic> ? query, Map<String, String> ? headers}) → Future<void> -
Fetch a list of resources and auto-manage loading/success/error/empty states.
inherited
-
fetchOne(
String url, bool fromMap(Map< String, dynamic> ), {String dataKey = 'data', Map<String, dynamic> ? query, Map<String, String> ? headers}) → Future<void> -
Fetch a single resource and auto-manage loading/success/error states.
inherited
-
getError(
String field) → String? -
Get the validation error message for a field.
inherited
-
getRecoveryCodes(
{required Map< String, String> proof}) → Future<List< String> ?> - Retrieves the current two-factor authentication recovery codes.
-
getSessions(
) → Future< List< Map< ?>String, dynamic> > - Retrieves the current browser sessions.
-
handleApiError(
MagicResponse response, {String? fallback}) → void -
Handle API error response automatically.
inherited
-
hasError(
String field) → bool -
Check if a field has a validation error.
inherited
-
Navigate to wherever a signed-in user should land after authenticating.
inherited
-
Navigate to
pathwhen a navigator context is available.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
override
-
onClose(
) → void -
Called when the controller is about to be disposed.
inherited
-
onInit(
) → void -
Called when the controller is first created.
inherited
-
profile(
) → Widget - Render profile settings view via registry key.
-
refreshUI(
) → void -
Refresh the UI by notifying listeners.
inherited
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
renderState(
Widget onSuccess(bool state), {Widget? onLoading, Widget onError(String message)?, Widget? onEmpty}) → Widget -
Render UI based on current status.
inherited
-
resetQuietly(
) → void - Clears errors and returns to the empty state without notifying.
-
sendEmailVerification(
) → Future< void> - Sends a verification email to the authenticated user's email address.
-
setEmpty(
) → void -
Set empty state (no data).
inherited
-
setError(
String message) → void -
Set error state with message.
inherited
-
setErrorsFromMap(
Map< String, List< errors) → voidString> > -
Set validation errors from a raw wire error map, keyed by
errorFieldFor.inherited -
setErrorsFromResponse(
MagicResponse response) → void -
Set validation errors from an API response.
inherited
-
setLoading(
) → void -
Set loading state.
inherited
-
setState(
bool? newState, {RxStatus? status, bool notify = true}) → void -
Update state and/or status.
inherited
-
setSuccess(
bool data) → void -
Set success state with data.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
validate(
Map< String, dynamic> data, Map<String, List< rules) → Map<Rule> >String, dynamic> -
Validate the given data against the rules.
inherited
-
validateRequest(
FormRequest request, Map< String, dynamic> data) → Map<String, dynamic> -
Run a
FormRequestthrough this mixin's error bag instead ofFormRequest.validate().inherited -
validateRequestAsync(
FormRequest request, Map< String, dynamic> data) → Future<Map< String, dynamic> > -
Same contract as
validateRequest, but validates throughValidator.validateAsyncso anyAsyncRuleinrequest's rules actually runs.inherited -
withoutNotifying<
T> (Future< T> action()) → Future<T> -
Execute
actionwithout triggering UI notifications.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance → MagicStarterProfileController
-
no setter