Avatar group
An avatar group shows who is involved when space is limited. Keep the full membership available when the group can show only a few faces.
Invite a reviewer
#Start with Ana and Jo. Invite Kim to see how the look fits a third reviewer, then remove Kim.
components/avatar-group/appliance/invite_reviewer.dart
import 'package:flutter/widgets.dart';
import 'package:appliance_ui/appliance_ui.dart';
class InviteReviewer extends StatefulWidget {
const InviteReviewer({super.key});
@override
State<InviteReviewer> createState() => _InviteReviewerState();
}
class _InviteReviewerState extends State<InviteReviewer> {
bool invited = false;
@override
Widget build(BuildContext context) {
final names = ['Ana Lee', 'Jo Ray', if (invited) 'Kim Yu'];
return ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 440),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
ApplianceAvatarGroup(names: names, max: 2),
const SizedBox(height: 12),
Text(names.join(', ')),
const SizedBox(height: 12),
ApplianceButton(
invited ? 'Remove Kim' : 'Invite Kim',
onPressed: () => setState(() => invited = !invited),
),
],
),
);
}
}
Parameters
ApplianceAvatarGroup API ↗names- Whose, in order.
slotIds- Their pictures' media slots, by name.
max- The most portholes, the last counting the rest.
size- Each one's diameter.
style- Overrides the component’s themed appearance for this instance.
Shared behaviour
- Keyboard and focus. Use Tab to reach Invite Kim, then activate the same control to remove the invitation.
- Screen readers. Compare the group’s name or count with the names listed beneath it. The list includes everyone, including anyone represented by an overflow count.
- Direction and type. Check which edge holds the overflow count in RTL. The written names can wrap at larger text sizes.