fix conditional rendering of popover actions
This commit is contained in:
parent
786c8cb3e2
commit
2ec442b35b
6 changed files with 7 additions and 1 deletions
|
|
@ -7,6 +7,7 @@ extension ShowUserPopover on BuildContext {
|
||||||
void showUserPopover(
|
void showUserPopover(
|
||||||
MembershipContent member,
|
MembershipContent member,
|
||||||
String userId, {
|
String userId, {
|
||||||
|
String? roomId,
|
||||||
required Offset globalPosition,
|
required Offset globalPosition,
|
||||||
}) => showContextMenu(
|
}) => showContextMenu(
|
||||||
globalPosition: globalPosition,
|
globalPosition: globalPosition,
|
||||||
|
|
@ -16,7 +17,7 @@ extension ShowUserPopover on BuildContext {
|
||||||
padding: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
padding: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
||||||
child: IconTheme(
|
child: IconTheme(
|
||||||
data: IconThemeData(),
|
data: IconThemeData(),
|
||||||
child: UserPopover(member, userId),
|
child: UserPopover(member, userId, roomId: roomId),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@ class MentionChip extends ConsumerWidget {
|
||||||
context.showUserPopover(
|
context.showUserPopover(
|
||||||
membership,
|
membership,
|
||||||
mention,
|
mention,
|
||||||
|
roomId: roomId,
|
||||||
globalPosition: details.globalPosition,
|
globalPosition: details.globalPosition,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ class MessageAvatar extends ConsumerWidget {
|
||||||
onTapUp: (details) => context.showUserPopover(
|
onTapUp: (details) => context.showUserPopover(
|
||||||
value,
|
value,
|
||||||
event.sender,
|
event.sender,
|
||||||
|
roomId: event.roomId,
|
||||||
globalPosition: details.globalPosition,
|
globalPosition: details.globalPosition,
|
||||||
),
|
),
|
||||||
child: AvatarOrHash(
|
child: AvatarOrHash(
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ class MessageDisplayname extends ConsumerWidget {
|
||||||
? (details) => context.showUserPopover(
|
? (details) => context.showUserPopover(
|
||||||
value,
|
value,
|
||||||
event.sender,
|
event.sender,
|
||||||
|
roomId: event.roomId,
|
||||||
globalPosition: details.globalPosition,
|
globalPosition: details.globalPosition,
|
||||||
)
|
)
|
||||||
: null,
|
: null,
|
||||||
|
|
|
||||||
|
|
@ -83,6 +83,7 @@ class MemberList extends HookConsumerWidget {
|
||||||
onTapUp: (details) => context.showUserPopover(
|
onTapUp: (details) => context.showUserPopover(
|
||||||
member.content as MembershipContent,
|
member.content as MembershipContent,
|
||||||
member.stateKey!,
|
member.stateKey!,
|
||||||
|
roomId: roomId,
|
||||||
globalPosition: details.globalPosition,
|
globalPosition: details.globalPosition,
|
||||||
),
|
),
|
||||||
child: ListTile(
|
child: ListTile(
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ class MembershipRenderer extends StatelessWidget {
|
||||||
onTapUp: (details) => context.showUserPopover(
|
onTapUp: (details) => context.showUserPopover(
|
||||||
content,
|
content,
|
||||||
event.stateKey!,
|
event.stateKey!,
|
||||||
|
roomId: event.roomId,
|
||||||
globalPosition: details.globalPosition,
|
globalPosition: details.globalPosition,
|
||||||
),
|
),
|
||||||
child: Text(
|
child: Text(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue