build method
- dynamic context,
- dynamic ref
Implementation
@override
Widget build(BuildContext context, WidgetRef ref) {
final canEdit = ref
.watch(roomMembershipProvider(parentId))
.valueOrNull
?.canString('CanLinkSpaces') ==
true;
if (!canEdit) {
// user doesn’t have the permission. disappear
return const SizedBox.shrink();
}
return PopupMenuButton(
icon: const Icon(Icons.more_vert),
itemBuilder: (context) => _menu(context, ref),
);
}