fix delete conversation logic

This commit is contained in:
Salvatore Giordano
2020-12-10 14:42:15 +01:00
parent b85ed04170
commit 0534488b94
5 changed files with 158 additions and 167 deletions
+6 -2
View File
@@ -100,7 +100,7 @@ class ChannelHeader extends StatelessWidget implements PreferredSizeWidget {
child: Center(
child: ChannelImage(
onTap: onImageTap ??
() {
() async {
if (channel.memberCount == 2 && channel.isDistinct) {
final currentUser = StreamChat.of(context).user;
final otherUser = channel.state.members.firstWhere(
@@ -108,7 +108,7 @@ class ChannelHeader extends StatelessWidget implements PreferredSizeWidget {
orElse: () => null,
);
if (otherUser != null) {
Navigator.push(
final pop = await Navigator.push(
context,
MaterialPageRoute(
builder: (context) => StreamChannel(
@@ -119,6 +119,10 @@ class ChannelHeader extends StatelessWidget implements PreferredSizeWidget {
),
),
);
if (pop == true) {
Navigator.pop(context);
}
}
}
},