Skip to main content

codifyiq_group_manager 2.0.0 copy "codifyiq_group_manager: ^2.0.0" to clipboard
codifyiq_group_manager: ^2.0.0 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.

2.0.0 #

  • Breaking: now built on material_ui, Flutter's standalone Material library, instead of the copy bundled in the Flutter SDK. Your app must use material_ui too, otherwise the widgets won't pick up your theme. To migrate your app, run dart fix --apply --code=migrate_design_widgets.
  • Breaking: requires Flutter 3.44 / Dart 3.12 or later.
  • Breaking: requires codifyiq_user_avatar 2.0.0 or later.

1.4.1 #

  • GroupMembersView can narrow its list to one role. With roles passed, 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 updating rolesById — leaves the list and the selection, and when nothing matches the empty state names the role. With roles omitted, the view is unchanged.
  • GroupMembersView rows 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 with roles omitted. 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.
  • GroupMembersView and BulkSelectionBar no 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 GroupAssignmentField and MemberAssignmentField — e.g. a group that can view a folder versus one that can edit it, or a group's owner versus a plain member. Pass roles (a list of the new AssignmentRole: id, label, optional description) and rolesById (the current role per selected id), and each chip reads name · 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 through onRoleChanged(id, roleId). Items added through the picker are reported through onChanged as before, then through onRoleChanged with defaultRoleId. The fields stay value-driven — they never store roles, so apply each change to your own rolesById.
  • Locked chips, and every chip in a disabled field, show their role but can't change it. A selected id missing from rolesById shows no role but still opens the menu with nothing checked, so it can be given one; a role id that isn't in roles shows the raw id and can still be changed.
  • singleLine and maxVisibleChips account 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.
  • GroupChip and PrincipalChip take an optional roleLabel (display only) for read-only summaries, plus onRolePressed, which shows a drop-down glyph and takes the chip-body tap in place of onPressed.
  • With roles omitted, both fields render and behave exactly as before.
  • GroupMembersView takes the same roles, rolesById, and defaultRoleId, so a group's own roster can show who is an owner and who is a plain member. Each row shows its role as an Owner ▾ 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, its onRoleChanged(Set<String> ids, String roleId) receives a set of ids. Members added through "Edit members" are reported through onMembersAdded first, then through onRoleChanged with defaultRoleId. Locked members show their role read-only, a member missing from rolesById shows "Set role" and can be given one, and with onRoleChanged omitted roles are display-only. With roles omitted 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), plus PrincipalAvatar and PrincipalChip. The roster stays caller-owned: map your own user type onto Principal at the widget boundary, exactly as you already supply the Group catalog. copyWith produces modified copies. Avatars are rendered by UserAvatar from codifyiq_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. PrincipalAvatar takes headers and imageProviderBuilder — matching UserAvatar in codifyiq_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, and MemberAssignmentField expose the pair as avatarHeaders / avatarImageProviderBuilder and pass it to every member avatar they render, including the ones inside their pickers; PrincipalChip takes it as headers / imageProviderBuilder. Pass a stable builder reference — a closure allocated inside build re-fetches the photo every frame. For a photo that isn't a fetchable URL at all, hand Principal the bytes instead of a URL: photoBase64 for the base64 string a directory or OAuth provider gives you, photoBytes for raw bytes, or imageProvider for a FileImage / AssetImage. Each takes precedence over imageUrl and renders through the same circular clip and initials/icon fallback, and the first two can be built inline in build — the avatar owns the decode, and Principal compares 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), and onMembersAdded / onMembersRemoved hooks for persisting to a backend. Pass it as the destination of GroupManagerView.onTap to drill from the catalog into a group's members. Use lockedMemberIds for memberships that can't be removed — e.g. a group's owner — mirroring lockedIds elsewhere.
  • MemberAssignmentField — the counterpart of GroupAssignmentField for a single group inline on a form, with the same chips, lockedIds, maxVisibleChips, and singleLine options.
  • MemberPicker — the counterpart of GroupPicker: a searchable, multi-select member picker that adapts between a bottom sheet (compact widths) and a dialog (large screens).
  • GroupAssignmentField and MemberAssignmentField now 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 with sizeAnimationDuration, or pass Duration.zero for 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, and GroupBulkAssignmentDialog.
  • 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. setMembers rewrites 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; showRemoval accepts lockedIds to keep protected groups off the offered list.
  • maxVisibleChips on GroupAssignmentField — cap visible chips, collapsing the rest behind "+N more".
  • singleLine on GroupAssignmentField — a denser layout with the label, chips, and edit button on one row.
  • destructive on GroupPicker — 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 on Group.
  • Fixed: GroupPicker's action row could overflow with a long confirmLabel; it now wraps instead.

1.1.0 #

  • lockedIds on GroupAssignmentField, GroupPicker, GroupManagerView, and GroupListView — 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.
  • footer on GroupManagerView and GroupListView — 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).
  • GroupManagerView and GroupListView — drop-in Material 3 surfaces for creating, editing, and deleting groups, with cascade-unassign on delete and built-in search to filter long catalogs. GroupManagerView caps its content to a comfortable measure and centers it on large screens (configurable via maxContentWidth). Intercept persistence with onCreate / onEdit / onDelete to 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 active ColorScheme, 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 via editLabel / 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, and GroupAvatar — composable building blocks for custom group-management screens.
0
likes
160
points
83
downloads

Documentation

API reference

Publisher

verified publishercodifyiq.com

Weekly Downloads

Material 3 widgets for managing flat authorization groups, worked from either end: assign groups to a user, or add members to a group.

Repository (GitHub)
View/report issues

Topics

#codifyiq #ui #widget #authorization

License

MIT (license)

Dependencies

codifyiq_user_avatar, flutter, material_ui

More

Packages that depend on codifyiq_group_manager