MagicStarterTeamController class

Team controller for Magic Starter plugin.

Inheritance

Properties

activeTeamId → dynamic
Get the active team ID — from explicit value or team resolver.
no setter
activeTeamName → String?
Get the active team name, consistent with activeTeamId.
no setter
currentTeamId → ValueNotifier
Team context used by team-scoped endpoints.
final
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
invitations → ValueNotifier<List<Map<String, dynamic>>>
Pending invitations.
final
isDisposed → bool
Whether the controller has been disposed.
no setterinherited
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
members → ValueNotifier<List<Map<String, dynamic>>>
Current team members.
final
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
settingsViewMountCount ↔ int
Count of currently mounted MagicStarterTeamSettingsView instances.
getter/setter pair
validationErrors ↔ Map<String, String>
Current validation errors keyed by field name.
getter/setter pairinherited

Methods

acceptInvitation() → Widget
Render invitation accept view via registry key.
addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
authorize(String ability, [Object? arguments]) → void
Authorize an action against the current Auth.user via the Gate.
inherited
cancelInvitation(dynamic invitationId) → Future<bool>
Cancel a pending invitation.
clearErrors() → void
Clear all validation errors.
inherited
clearFieldError(String field) → void
Clear a specific field's validation error.
inherited
create() → Widget
Render create team view via registry key.
dispose() → void
Runs onClose if it has not run yet, then releases the notifier.
doAcceptInvitation({required String token}) → Future<bool>
Accept a team invitation by token.
doCreate({required String name}) → Future<bool>
Create new team.
doInvite({required String email, required String role}) → Future<bool>
Invite member to current team.
doUpdate({required String name}) → Future<bool>
Update current team settings.
edit() → Widget
Render team settings view via registry key.
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
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
loadMembersAndInvitations({bool quietStart = false}) → Future<void>
Load members and invitations for the active team.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
onClose() → void
Called when the controller is about to be disposed.
inherited
onInit() → void
Called when the controller is first created.
inherited
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
removeMember(dynamic memberId) → Future<bool>
Remove a member from current team.
renderState(Widget onSuccess(bool state), {Widget? onLoading, Widget onError(String message)?, Widget? onEmpty}) → Widget
Render UI based on current status.
inherited
resetForSession() → Future<void>
Drops the previous session's team members and invitations, re-points currentTeamId at whatever the team resolver now calls current, then refetches only while a settings screen is actually showing.
resetQuietly() → void
Clears errors and returns to the empty state without notifying.
setEmpty() → void
Set empty state (no data).
inherited
setError(String message) → void
Set error state with message.
inherited
setErrorsFromMap(Map<String, List<String>> errors) → void
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
switchTeam(dynamic teamId) → Future<bool>
Switch active team.
toString() → String
A string representation of this object.
inherited
validate(Map<String, dynamic> data, Map<String, List<Rule>> rules) → Map<String, dynamic>
Validate the given data against the rules.
inherited
validateRequest(FormRequest request, Map<String, dynamic> data) → Map<String, dynamic>
Run a FormRequest through this mixin's error bag instead of FormRequest.validate().
inherited
validateRequestAsync(FormRequest request, Map<String, dynamic> data) → Future<Map<String, dynamic>>
Same contract as validateRequest, but validates through Validator.validateAsync so any AsyncRule in request's rules actually runs.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Properties

instance → MagicStarterTeamController
no setter