build method

  1. @override
dynamic build(
  1. dynamic context,
  2. 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),
  );
}