fix: fixed for all chats
This commit is contained in:
@@ -374,7 +374,6 @@ class _ChannelListPageState extends State<ChannelListPage> {
|
||||
),
|
||||
channelWidget: ChannelPage(),
|
||||
onChannelLongPress: (channel) {
|
||||
if (!channel.isDistinct)
|
||||
_showChannelDetailsModal(channel);
|
||||
},
|
||||
),
|
||||
|
||||
@@ -16,6 +16,8 @@ class ChannelActionsModal extends StatefulWidget {
|
||||
class _ChannelActionsModalState extends State<ChannelActionsModal> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var channel = StreamChannel.of(context).channel;
|
||||
|
||||
return Material(
|
||||
clipBehavior: Clip.antiAlias,
|
||||
shape: RoundedRectangleBorder(
|
||||
@@ -72,6 +74,37 @@ class _ChannelActionsModalState extends State<ChannelActionsModal> {
|
||||
SizedBox(
|
||||
height: 17.0,
|
||||
),
|
||||
if (channel.isDistinct && channel.memberCount == 2)
|
||||
Column(
|
||||
children: [
|
||||
UserAvatar(
|
||||
user: snapshot.data.members
|
||||
.firstWhere((e) => e.user.id != userAsMember.user.id)
|
||||
.user,
|
||||
constraints: BoxConstraints(
|
||||
maxHeight: 64.0,
|
||||
maxWidth: 64.0,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(32.0),
|
||||
),
|
||||
SizedBox(
|
||||
height: 6.0,
|
||||
),
|
||||
Text(
|
||||
snapshot.data.members
|
||||
.firstWhere((e) => e.user.id != userAsMember.user.id)
|
||||
.user
|
||||
.name,
|
||||
style: TextStyle(
|
||||
fontSize: 12.0,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
],
|
||||
),
|
||||
if (!(channel.isDistinct && channel.memberCount == 2))
|
||||
Container(
|
||||
height: 94.0,
|
||||
child: ListView.builder(
|
||||
@@ -118,6 +151,7 @@ class _ChannelActionsModalState extends State<ChannelActionsModal> {
|
||||
title: 'View Info',
|
||||
onTap: widget.onViewInfoTap,
|
||||
),
|
||||
if (!channel.isDistinct)
|
||||
OptionListTile(
|
||||
leading: StreamSvgIcon.userRemove(
|
||||
color: Color(0xff7a7a7a),
|
||||
@@ -126,7 +160,8 @@ class _ChannelActionsModalState extends State<ChannelActionsModal> {
|
||||
onTap: () async {
|
||||
var channel = StreamChannel.of(context).channel;
|
||||
|
||||
await channel.removeMembers([StreamChat.of(context).user.id]);
|
||||
await channel
|
||||
.removeMembers([StreamChat.of(context).user.id]);
|
||||
Navigator.pop(context);
|
||||
},
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user