From 4dd31d961ab32a1836cf1f306e66b36aef1cfc25 Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Fri, 3 Jan 2020 12:07:04 +0100 Subject: [PATCH] Only show invite button when possible --- lib/views/chat_details.dart | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/lib/views/chat_details.dart b/lib/views/chat_details.dart index 0d99211..9fa1a17 100644 --- a/lib/views/chat_details.dart +++ b/lib/views/chat_details.dart @@ -141,16 +141,18 @@ class _ChatDetailsState extends State { ), ], ), - ListTile( - title: Text("Invite contact"), - leading: Icon(Icons.add), - onTap: () => Navigator.of(context).push( - AppRoute.defaultRoute( - context, - InvitationSelection(widget.room), - ), - ), - ), + widget.room.canInvite + ? ListTile( + title: Text("Invite contact"), + leading: Icon(Icons.add), + onTap: () => Navigator.of(context).push( + AppRoute.defaultRoute( + context, + InvitationSelection(widget.room), + ), + ), + ) + : Container(), ], ) : i < members.length + 1