Merge branch 'main' into develop

This commit is contained in:
Salvatore Giordano
2021-07-29 12:08:51 +02:00
10 changed files with 24 additions and 24 deletions
@@ -87,7 +87,7 @@ class _GroupInfoScreenState extends State<GroupInfoScreen> {
}
var userMember = snapshot.data!.firstWhereOrNull(
(e) => e.user!.id == StreamChat.of(context).user!.id,
(e) => e.user!.id == StreamChat.of(context).currentUser!.id,
);
var isOwner = userMember?.role == 'owner';
@@ -211,7 +211,7 @@ class _GroupInfoScreenState extends State<GroupInfoScreen> {
child: InkWell(
onTap: () {
final userMember = groupMembers.firstWhereOrNull(
(e) => e.user!.id == StreamChat.of(context).user!.id,
(e) => e.user!.id == StreamChat.of(context).currentUser!.id,
);
_showUserInfoModal(member.user, userMember?.role == 'owner');
},
@@ -684,7 +684,7 @@ class _GroupInfoScreenState extends State<GroupInfoScreen> {
);
if (res == true) {
final channel = StreamChannel.of(context).channel;
await channel.removeMembers([StreamChat.of(context).user!.id]);
await channel.removeMembers([StreamChat.of(context).currentUser!.id]);
Navigator.pop(context);
}
},
@@ -738,7 +738,7 @@ class _GroupInfoScreenState extends State<GroupInfoScreen> {
if (_searchController!.text.isNotEmpty)
Filter.autoComplete('name', _userNameQuery),
Filter.notIn('id', [
StreamChat.of(context).user!.id,
StreamChat.of(context).currentUser!.id,
...channel.state!.members
.map<String?>(((e) => e.userId))
.whereType<String>(),
@@ -902,7 +902,7 @@ class _GroupInfoScreenState extends State<GroupInfoScreen> {
),
),
),
if (StreamChat.of(context).user!.id != user.id)
if (StreamChat.of(context).currentUser!.id != user.id)
_buildModalListTile(
context,
StreamSvgIcon.user(
@@ -918,7 +918,7 @@ class _GroupInfoScreenState extends State<GroupInfoScreen> {
var c = client.channel('messaging', extraData: {
'members': [
user.id,
StreamChat.of(context).user!.id,
StreamChat.of(context).currentUser!.id,
],
});
@@ -938,7 +938,7 @@ class _GroupInfoScreenState extends State<GroupInfoScreen> {
);
},
),
if (StreamChat.of(context).user!.id != user.id)
if (StreamChat.of(context).currentUser!.id != user.id)
_buildModalListTile(
context,
StreamSvgIcon.message(
@@ -954,7 +954,7 @@ class _GroupInfoScreenState extends State<GroupInfoScreen> {
var c = client.channel('messaging', extraData: {
'members': [
user.id,
StreamChat.of(context).user!.id,
StreamChat.of(context).currentUser!.id,
],
});
@@ -984,7 +984,7 @@ class _GroupInfoScreenState extends State<GroupInfoScreen> {
// // TODO: Add make owner implementation (Remaining from backend)
// }),
if (!channel.isDistinct &&
StreamChat.of(context).user!.id != user.id &&
StreamChat.of(context).currentUser!.id != user.id &&
isUserAdmin)
_buildModalListTile(
context,
@@ -1116,7 +1116,7 @@ class _GroupInfoScreenState extends State<GroupInfoScreen> {
var client = StreamChat.of(context);
if (extraData['name'] == null) {
final otherMembers =
members!.where((member) => member.user!.id != client.user!.id);
members!.where((member) => member.user!.id != client.currentUser!.id);
if (otherMembers.isNotEmpty) {
final maxWidth = width;
final maxChars = maxWidth / maxFontSize!;