codifyiq_group_manager 1.4.1
codifyiq_group_manager: ^1.4.1 copied to clipboard
Material 3 widgets for managing flat authorization groups, worked from either end: assign groups to a user, or add members to a group.
1.4.1 #
GroupMembersViewcan narrow its list to one role. Withrolespassed, a row of chips under the search field — "All members", then each role — shows only the members with the chosen role, combined with the search, so "who owns this group?" is one tap. The chosen chip shows the current filter; tap "All members" or the chosen chip again to clear it. Select-all selects only the members shown, and switching the filter deselects any member it hides, so bulk actions apply to what's on screen. A member whose role changes out of the filter — from the view or from your app updatingrolesById— leaves the list and the selection, and when nothing matches the empty state names the role. Withrolesomitted, the view is unchanged.GroupMembersViewrows now line up whether or not a member is locked. Roles form one column down the list, whether editable or read-only, and a locked row's lock badge sits where the Remove action does on other rows. This also holds in display-only views and withrolesomitted. The role column is capped in width, so a long role label is shortened with "…" instead of squeezing every member's name; screen readers still announce the full label.GroupMembersViewandBulkSelectionBarno longer overflow at phone widths or in a narrow split pane. On a narrow row, a member's role moves from beside Remove to a line under their name, still lined up with the other rows and still editable.BulkSelectionBar's "No members selected" / "N selected" label is shortened with "…" when the bar runs out of room, so it no longer overflows, with or without roles.
1.4.0 #
- Optional per-assignment roles on
GroupAssignmentFieldandMemberAssignmentField— e.g. a group that can view a folder versus one that can edit it, or a group's owner versus a plain member. Passroles(a list of the newAssignmentRole: id, label, optional description) androlesById(the current role per selected id), and each chip readsname · role ▾; tapping it opens a keyboard-reachable menu of the roles, with the current one checked and each description as a secondary line, and a pick is reported throughonRoleChanged(id, roleId). Items added through the picker are reported throughonChangedas before, then throughonRoleChangedwithdefaultRoleId. The fields stay value-driven — they never store roles, so apply each change to your ownrolesById. - Locked chips, and every chip in a disabled field, show their role but can't change it. A selected id missing from
rolesByIdshows no role but still opens the menu with nothing checked, so it can be given one; a role id that isn't inrolesshows the raw id and can still be changed. singleLineandmaxVisibleChipsaccount for the role's width, so overflow behind "+N more" stays correct.- One role set applies to every chip in a field; per-group role sets are not supported.
GroupChipandPrincipalChiptake an optionalroleLabel(display only) for read-only summaries, plusonRolePressed, which shows a drop-down glyph and takes the chip-body tap in place ofonPressed.- With
rolesomitted, both fields render and behave exactly as before. GroupMembersViewtakes the sameroles,rolesById, anddefaultRoleId, so a group's own roster can show who is an owner and who is a plain member. Each row shows its role as anOwner ▾action beside Remove that opens the same role menu; with members selected, the selection bar offers Set role to apply one role to every selected member at once. Because of that bulk path, itsonRoleChanged(Set<String> ids, String roleId)receives a set of ids. Members added through "Edit members" are reported throughonMembersAddedfirst, then throughonRoleChangedwithdefaultRoleId. Locked members show their role read-only, a member missing fromrolesByIdshows "Set role" and can be given one, and withonRoleChangedomitted roles are display-only. Withrolesomitted the view renders and behaves exactly as before.
1.3.0 #
- Membership can now be managed from either end of the relation. Everything that assigns groups to a member has a mirror that adds members to a group; both read and write the same assignments, so an edit made from one side is immediately visible from the other.
Principal— an immutable member model (id, name, optional description/photo/icon), plusPrincipalAvatarandPrincipalChip. The roster stays caller-owned: map your own user type ontoPrincipalat the widget boundary, exactly as you already supply theGroupcatalog.copyWithproduces modified copies. Avatars are rendered byUserAvatarfromcodifyiq_user_avatar, so a member looks the same here as on every other screen in your app — including its initials, which skip bracketed qualifiers common in enterprise directories ("Alice [Contractor]"reads as"AL", not"A[").- Member photos load the same way as everywhere else in your app.
PrincipalAvatartakesheadersandimageProviderBuilder— matchingUserAvatarincodifyiq_user_avatar— so a photo behind an authenticated endpoint loads instead of silently falling back to initials, and a photo already in your app's cache is served from it rather than refetched.GroupMembersView,MemberPicker, andMemberAssignmentFieldexpose the pair asavatarHeaders/avatarImageProviderBuilderand pass it to every member avatar they render, including the ones inside their pickers;PrincipalChiptakes it asheaders/imageProviderBuilder. Pass a stable builder reference — a closure allocated insidebuildre-fetches the photo every frame. For a photo that isn't a fetchable URL at all, handPrincipalthe bytes instead of a URL:photoBase64for the base64 string a directory or OAuth provider gives you,photoBytesfor raw bytes, orimageProviderfor aFileImage/AssetImage. Each takes precedence overimageUrland renders through the same circular clip and initials/icon fallback, and the first two can be built inline inbuild— the avatar owns the decode, andPrincipalcompares bytes by value, so a member list doesn't churn. GroupMembersView— a drop-in surface for one group's membership, with search, an "Edit members" picker, per-row and bulk removal (both confirmed), andonMembersAdded/onMembersRemovedhooks for persisting to a backend. Pass it as the destination ofGroupManagerView.onTapto drill from the catalog into a group's members. UselockedMemberIdsfor memberships that can't be removed — e.g. a group's owner — mirroringlockedIdselsewhere.MemberAssignmentField— the counterpart ofGroupAssignmentFieldfor a single group inline on a form, with the same chips,lockedIds,maxVisibleChips, andsingleLineoptions.MemberPicker— the counterpart ofGroupPicker: a searchable, multi-select member picker that adapts between a bottom sheet (compact widths) and a dialog (large screens).GroupAssignmentFieldandMemberAssignmentFieldnow animate their resize instead of snapping in one frame when membership changes — adding or removing a chip, showing the first chip in place of the empty hint, or expanding the "+N more" overflow. Tune it withsizeAnimationDuration, or passDuration.zerofor the previous instant behavior. The transition is skipped automatically when the platform asks for reduced motion.- Unsaved work is no longer lost to an accidental dismissal. Once the group editor has been typed in, or a picker's selection has been changed, clicking off the surface, pressing Escape, or the system back gesture asks "Discard changes?" first; Cancel goes through the same prompt. An untouched editor or picker still closes immediately. This applies to
GroupEditorDialog,GroupPicker,MemberPicker, andGroupBulkAssignmentDialog. - On compact widths the pickers' bottom sheet no longer closes on a downward swipe — swipe-to-dismiss bypasses the confirmation above, so dismissal is via the barrier, back gesture, or Cancel.
GroupManagerController.membersOf/memberCount/setMembers— read and rewrite a group's membership directly.setMembersrewrites only that group's column, so a principal removed from one group keeps every other group they belong to.
1.2.0 #
GroupManagerController.assignMany/unassignMany— add or remove groups across many principals in one call.GroupBulkAssignmentDialog— a picker for choosing groups to bulk-assign (show) or bulk-remove (showRemoval) across many principals;showRemovalacceptslockedIdsto keep protected groups off the offered list.maxVisibleChipsonGroupAssignmentField— cap visible chips, collapsing the rest behind "+N more".singleLineonGroupAssignmentField— a denser layout with the label, chips, and edit button on one row.destructiveonGroupPicker— tints checkboxes and the confirm button with the error color, for pickers where checking a box means removing rather than keeping.BulkSelectionBar— a fixed-height selection toolbar (select all/none + bulk actions) for any list, with no dependency onGroup.- Fixed:
GroupPicker's action row could overflow with a longconfirmLabel; it now wraps instead.
1.1.0 #
lockedIdsonGroupAssignmentField,GroupPicker,GroupManagerView, andGroupListView— designate permanent groups (e.g. an "Admin" group that always has access). When assigning, locked groups always show as chips bearing a lock glyph in place of the remove affordance (tooltip: "Required — can't be removed"), appear checked-and-disabled with the same lock glyph in the picker, and are always present in the resulting selection regardless of user interaction. In the catalog, a locked group's row shows a lock badge (tooltip: "Locked — can't be deleted") and offers no Delete action (it stays editable), so the permanent group your assignments depend on can't be deleted out from under them.footeronGroupManagerViewandGroupListView— render a help or policy note beneath the last group that scrolls with the catalog.
1.0.0 #
- Initial release.
GroupManagerController+GroupManagerScope— a UI-only state container for a flat catalog of authorization groups and their assignment to principals (no nested groups, no separate roles).GroupManagerViewandGroupListView— drop-in Material 3 surfaces for creating, editing, and deleting groups, with cascade-unassign on delete and built-in search to filter long catalogs.GroupManagerViewcaps its content to a comfortable measure and centers it on large screens (configurable viamaxContentWidth). Intercept persistence withonCreate/onEdit/onDeleteto wire create/edit/delete to a backend before (or instead of) mutating the controller.GroupColor— group accents are theme-derived roles (primary/secondary/tertiary/neutral) resolved against the activeColorScheme, so they adapt to light/dark; a stable role is auto-assigned when none is set.GroupAssignmentField— assign one or more groups to a target via removable chips and a stationary edit button that opens a searchable picker (which both adds and removes membership). Customize the trigger's tooltip and glyph viaeditLabel/editIcon— e.g. an authorization icon when granting access rather than editing membership.GroupPicker— a searchable, multi-select group picker that adapts between a bottom sheet (compact widths) and a dialog (large screens).GroupEditorDialog,GroupChip, andGroupAvatar— composable building blocks for custom group-management screens.