VooMultiSwitcherConfig class
Configuration for the multi-switcher component.
The multi-switcher combines organization and user switching into a single, animated component that displays as a card (closed) and expands to a modal (open) within the navigation drawer.
Example usage:
VooMultiSwitcherConfig(
// Organization data
organizations: myOrganizations,
selectedOrganization: currentOrg,
onOrganizationChanged: (org) => setState(() => currentOrg = org),
// User data
userName: 'John Doe',
userEmail: 'john@example.com',
status: VooUserStatus.online,
// Actions
onSettingsTap: () => openSettings(),
onLogout: () => logout(),
)
Constructors
-
VooMultiSwitcherConfig({List<
VooOrganization> organizations = const [], VooOrganization? selectedOrganization, ValueChanged<VooOrganization> ? onOrganizationChanged, VoidCallback? onCreateOrganization, String? createOrganizationLabel, String? userName, String? userEmail, String? avatarUrl, Widget? avatarWidget, String? initials, VooUserStatus? status, List<VooMultiSwitcherUser> ? users, VooMultiSwitcherUser? selectedUser, ValueChanged<VooMultiSwitcherUser> ? onUserChanged, VoidCallback? onAddUser, String? addUserLabel, VoidCallback? onSettingsTap, VoidCallback? onLogout, bool showOrganizationSection = true, bool showUserSection = true, bool showSearch = false, String? organizationSectionTitle, String? userSectionTitle, String? searchHint, VooMultiSwitcherStyle? style, bool? compact, String? tooltip, bool isLoading = false, bool mobilePriority = false, Widget cardBuilder(BuildContext context, VooMultiSwitcherCardData data)?, Widget modalBuilder(BuildContext context, VooMultiSwitcherModalData data)?, Widget organizationSectionBuilder(BuildContext context, VooMultiSwitcherModalData data)?, Widget userSectionBuilder(BuildContext context, VooMultiSwitcherModalData data)?}) -
const
Properties
- addUserLabel → String?
-
Label for the add user button
final
- avatarUrl → String?
-
URL for the current user's avatar
final
- avatarWidget → Widget?
-
Custom widget for the current user's avatar (overrides avatarUrl)
final
- cardBuilder → Widget Function(BuildContext context, VooMultiSwitcherCardData data)?
-
Custom builder for the card (closed state).
When provided, completely overrides the default card UI.
final
- compact → bool?
-
Whether to show in compact mode (avatar only)
When null, auto-detects from VooCollapseState in widget tree.
final
- createOrganizationLabel → String?
-
Label for the create organization button
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- initials → String?
-
Initials to show if no avatar is provided
final
- isLoading → bool
-
Whether the switcher is in a loading state.
When true, shows a loading indicator on the card and disables interaction.
final
-
Custom menu items to display in the user section
final
- mobilePriority → bool
-
Whether to include in mobile bottom navigation (max 5 items).
final
- modalBuilder → Widget Function(BuildContext context, VooMultiSwitcherModalData data)?
-
Custom builder for the modal (open state).
When provided, completely overrides the default modal UI.
final
-
Label for the nav item. Defaults to user name or 'Account'.
final
-
Sort order for nav item positioning in mobile bottom navigation.
final
- onAddUser → VoidCallback?
-
Callback to add a new user/account
final
- onCreateOrganization → VoidCallback?
-
Callback to create a new organization
final
- onLogout → VoidCallback?
-
Callback when logout is requested
final
-
onOrganizationChanged
→ ValueChanged<
VooOrganization> ? -
Callback when an organization is selected
final
- onSettingsTap → VoidCallback?
-
Callback when settings is tapped
final
-
onUserChanged
→ ValueChanged<
VooMultiSwitcherUser> ? -
Callback when a user is selected
final
-
organizations
→ List<
VooOrganization> -
List of organizations available for switching
final
- organizationSectionBuilder → Widget Function(BuildContext context, VooMultiSwitcherModalData data)?
-
Custom builder for the organization section.
When provided, replaces the default organization list.
final
- organizationSectionTitle → String?
-
Title for the organization section
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- searchHint → String?
-
Hint text for the search field
final
- selectedOrganization → VooOrganization?
-
Currently selected organization
final
- selectedUser → VooMultiSwitcherUser?
-
Currently selected user (when using multi-account)
final
-
Whether to show as a navigation item in rail/bottom nav.
final
- showOrganizationSection → bool
-
Whether to show the organization section in the modal
final
- showSearch → bool
-
Whether to show the search field in the modal
final
- showUserSection → bool
-
Whether to show the user section in the modal
final
- status → VooUserStatus?
-
Current user's online status
final
- style → VooMultiSwitcherStyle?
-
Custom style configuration
final
- tooltip → String?
-
Tooltip text when hovering over the card
final
- userEmail → String?
-
Current user's email address
final
- userName → String?
-
Current user's display name
final
-
users
→ List<
VooMultiSwitcherUser> ? -
List of users available for switching (for multi-account support)
final
- userSectionBuilder → Widget Function(BuildContext context, VooMultiSwitcherModalData data)?
-
Custom builder for the user section.
When provided, replaces the default user section.
final
- userSectionTitle → String?
-
Title for the user section
final
Methods
-
copyWith(
{List< VooOrganization> ? organizations, VooOrganization? selectedOrganization, ValueChanged<VooOrganization> ? onOrganizationChanged, VoidCallback? onCreateOrganization, String? createOrganizationLabel, String? userName, String? userEmail, String? avatarUrl, Widget? avatarWidget, String? initials, VooUserStatus? status, List<VooMultiSwitcherUser> ? users, VooMultiSwitcherUser? selectedUser, ValueChanged<VooMultiSwitcherUser> ? onUserChanged, VoidCallback? onAddUser, String? addUserLabel, VoidCallback? onSettingsTap, VoidCallback? onLogout, bool? showOrganizationSection, bool? showUserSection, bool? showSearch, String? organizationSectionTitle, String? userSectionTitle, String? searchHint, VooMultiSwitcherStyle? style, bool? compact, String? tooltip, bool? isLoading, bool? mobilePriority, Widget cardBuilder(BuildContext context, VooMultiSwitcherCardData data)?, Widget modalBuilder(BuildContext context, VooMultiSwitcherModalData data)?, Widget organizationSectionBuilder(BuildContext context, VooMultiSwitcherModalData data)?, Widget userSectionBuilder(BuildContext context, VooMultiSwitcherModalData data)?}) → VooMultiSwitcherConfig - Creates a copy with the given fields replaced
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited