|
|
|
@ -69,16 +69,17 @@ class ChatDetailsView extends StatelessWidget {
|
|
|
|
|
icon: Icon(Icons.adaptive.share_outlined),
|
|
|
|
|
onPressed: () => FluffyShare.share(
|
|
|
|
|
AppConfig.inviteLinkPrefix + room.canonicalAlias,
|
|
|
|
|
context),
|
|
|
|
|
context,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
ChatSettingsPopupMenu(room, false)
|
|
|
|
|
],
|
|
|
|
|
title: Text(
|
|
|
|
|
room.getLocalizedDisplayname(
|
|
|
|
|
MatrixLocals(L10n.of(context)!)),
|
|
|
|
|
MatrixLocals(L10n.of(context)!),
|
|
|
|
|
),
|
|
|
|
|
backgroundColor:
|
|
|
|
|
Theme.of(context).appBarTheme.backgroundColor,
|
|
|
|
|
),
|
|
|
|
|
backgroundColor: Theme.of(context).appBarTheme.backgroundColor,
|
|
|
|
|
flexibleSpace: FlexibleSpaceBar(
|
|
|
|
|
background: ContentBanner(
|
|
|
|
|
mxContent: room.avatar,
|
|
|
|
@ -114,8 +115,7 @@ class ChatDetailsView extends StatelessWidget {
|
|
|
|
|
title: Text(
|
|
|
|
|
L10n.of(context)!.groupDescription,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color:
|
|
|
|
|
Theme.of(context).colorScheme.secondary,
|
|
|
|
|
color: Theme.of(context).colorScheme.secondary,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
@ -123,7 +123,8 @@ class ChatDetailsView extends StatelessWidget {
|
|
|
|
|
if (room.topic.isNotEmpty)
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.symmetric(
|
|
|
|
|
horizontal: 16.0),
|
|
|
|
|
horizontal: 16.0,
|
|
|
|
|
),
|
|
|
|
|
child: LinkText(
|
|
|
|
|
text: room.topic.isEmpty
|
|
|
|
|
? L10n.of(context)!.addGroupDescription
|
|
|
|
@ -151,47 +152,53 @@ class ChatDetailsView extends StatelessWidget {
|
|
|
|
|
title: Text(
|
|
|
|
|
L10n.of(context)!.settings,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color:
|
|
|
|
|
Theme.of(context).colorScheme.secondary,
|
|
|
|
|
color: Theme.of(context).colorScheme.secondary,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
trailing: Icon(controller.displaySettings
|
|
|
|
|
trailing: Icon(
|
|
|
|
|
controller.displaySettings
|
|
|
|
|
? Icons.keyboard_arrow_down_outlined
|
|
|
|
|
: Icons.keyboard_arrow_right_outlined),
|
|
|
|
|
: Icons.keyboard_arrow_right_outlined,
|
|
|
|
|
),
|
|
|
|
|
onTap: controller.toggleDisplaySettings,
|
|
|
|
|
),
|
|
|
|
|
if (controller.displaySettings) ...[
|
|
|
|
|
if (room.canSendEvent('m.room.name'))
|
|
|
|
|
ListTile(
|
|
|
|
|
leading: CircleAvatar(
|
|
|
|
|
backgroundColor: Theme.of(context)
|
|
|
|
|
.scaffoldBackgroundColor,
|
|
|
|
|
backgroundColor:
|
|
|
|
|
Theme.of(context).scaffoldBackgroundColor,
|
|
|
|
|
foregroundColor: iconColor,
|
|
|
|
|
child: const Icon(
|
|
|
|
|
Icons.people_outline_outlined),
|
|
|
|
|
Icons.people_outline_outlined,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
title: Text(
|
|
|
|
|
L10n.of(context)!.changeTheNameOfTheGroup,
|
|
|
|
|
),
|
|
|
|
|
subtitle: Text(
|
|
|
|
|
room.getLocalizedDisplayname(
|
|
|
|
|
MatrixLocals(L10n.of(context)!),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
title: Text(L10n.of(context)!
|
|
|
|
|
.changeTheNameOfTheGroup),
|
|
|
|
|
subtitle: Text(room.getLocalizedDisplayname(
|
|
|
|
|
MatrixLocals(L10n.of(context)!))),
|
|
|
|
|
onTap: controller.setDisplaynameAction,
|
|
|
|
|
),
|
|
|
|
|
if (room.joinRules == JoinRules.public)
|
|
|
|
|
ListTile(
|
|
|
|
|
leading: CircleAvatar(
|
|
|
|
|
backgroundColor: Theme.of(context)
|
|
|
|
|
.scaffoldBackgroundColor,
|
|
|
|
|
backgroundColor:
|
|
|
|
|
Theme.of(context).scaffoldBackgroundColor,
|
|
|
|
|
foregroundColor: iconColor,
|
|
|
|
|
child: const Icon(Icons.link_outlined),
|
|
|
|
|
),
|
|
|
|
|
onTap: controller.editAliases,
|
|
|
|
|
title:
|
|
|
|
|
Text(L10n.of(context)!.editRoomAliases),
|
|
|
|
|
title: Text(L10n.of(context)!.editRoomAliases),
|
|
|
|
|
subtitle: Text(
|
|
|
|
|
(room.canonicalAlias.isNotEmpty)
|
|
|
|
|
? room.canonicalAlias
|
|
|
|
|
: L10n.of(context)!.none),
|
|
|
|
|
: L10n.of(context)!.none,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
ListTile(
|
|
|
|
|
leading: CircleAvatar(
|
|
|
|
@ -199,11 +206,11 @@ class ChatDetailsView extends StatelessWidget {
|
|
|
|
|
Theme.of(context).scaffoldBackgroundColor,
|
|
|
|
|
foregroundColor: iconColor,
|
|
|
|
|
child: const Icon(
|
|
|
|
|
Icons.insert_emoticon_outlined),
|
|
|
|
|
Icons.insert_emoticon_outlined,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
title: Text(L10n.of(context)!.emoteSettings),
|
|
|
|
|
subtitle:
|
|
|
|
|
Text(L10n.of(context)!.setCustomEmotes),
|
|
|
|
|
subtitle: Text(L10n.of(context)!.setCustomEmotes),
|
|
|
|
|
onTap: controller.goToEmoteSettings,
|
|
|
|
|
),
|
|
|
|
|
PopupMenuButton(
|
|
|
|
@ -213,81 +220,99 @@ class ChatDetailsView extends StatelessWidget {
|
|
|
|
|
if (room.canChangeJoinRules)
|
|
|
|
|
PopupMenuItem<JoinRules>(
|
|
|
|
|
value: JoinRules.public,
|
|
|
|
|
child: Text(JoinRules.public
|
|
|
|
|
.getLocalizedString(
|
|
|
|
|
MatrixLocals(L10n.of(context)!))),
|
|
|
|
|
child: Text(
|
|
|
|
|
JoinRules.public.getLocalizedString(
|
|
|
|
|
MatrixLocals(L10n.of(context)!),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
if (room.canChangeJoinRules)
|
|
|
|
|
PopupMenuItem<JoinRules>(
|
|
|
|
|
value: JoinRules.invite,
|
|
|
|
|
child: Text(JoinRules.invite
|
|
|
|
|
.getLocalizedString(
|
|
|
|
|
MatrixLocals(L10n.of(context)!))),
|
|
|
|
|
child: Text(
|
|
|
|
|
JoinRules.invite.getLocalizedString(
|
|
|
|
|
MatrixLocals(L10n.of(context)!),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
child: ListTile(
|
|
|
|
|
leading: CircleAvatar(
|
|
|
|
|
backgroundColor: Theme.of(context)
|
|
|
|
|
.scaffoldBackgroundColor,
|
|
|
|
|
backgroundColor:
|
|
|
|
|
Theme.of(context).scaffoldBackgroundColor,
|
|
|
|
|
foregroundColor: iconColor,
|
|
|
|
|
child: const Icon(Icons.shield_outlined)),
|
|
|
|
|
title: Text(L10n.of(context)!
|
|
|
|
|
.whoIsAllowedToJoinThisGroup),
|
|
|
|
|
child: const Icon(Icons.shield_outlined),
|
|
|
|
|
),
|
|
|
|
|
title: Text(
|
|
|
|
|
L10n.of(context)!.whoIsAllowedToJoinThisGroup,
|
|
|
|
|
),
|
|
|
|
|
subtitle: Text(
|
|
|
|
|
room.joinRules?.getLocalizedString(
|
|
|
|
|
MatrixLocals(L10n.of(context)!)) ??
|
|
|
|
|
MatrixLocals(L10n.of(context)!),
|
|
|
|
|
) ??
|
|
|
|
|
L10n.of(context)!.none,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
PopupMenuButton(
|
|
|
|
|
onSelected:
|
|
|
|
|
controller.setHistoryVisibilityAction,
|
|
|
|
|
onSelected: controller.setHistoryVisibilityAction,
|
|
|
|
|
itemBuilder: (BuildContext context) =>
|
|
|
|
|
<PopupMenuEntry<HistoryVisibility>>[
|
|
|
|
|
if (room.canChangeHistoryVisibility)
|
|
|
|
|
PopupMenuItem<HistoryVisibility>(
|
|
|
|
|
value: HistoryVisibility.invited,
|
|
|
|
|
child: Text(HistoryVisibility.invited
|
|
|
|
|
child: Text(
|
|
|
|
|
HistoryVisibility.invited
|
|
|
|
|
.getLocalizedString(
|
|
|
|
|
MatrixLocals(L10n.of(context)!))),
|
|
|
|
|
MatrixLocals(L10n.of(context)!),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
if (room.canChangeHistoryVisibility)
|
|
|
|
|
PopupMenuItem<HistoryVisibility>(
|
|
|
|
|
value: HistoryVisibility.joined,
|
|
|
|
|
child: Text(HistoryVisibility.joined
|
|
|
|
|
child: Text(
|
|
|
|
|
HistoryVisibility.joined
|
|
|
|
|
.getLocalizedString(
|
|
|
|
|
MatrixLocals(L10n.of(context)!))),
|
|
|
|
|
MatrixLocals(L10n.of(context)!),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
if (room.canChangeHistoryVisibility)
|
|
|
|
|
PopupMenuItem<HistoryVisibility>(
|
|
|
|
|
value: HistoryVisibility.shared,
|
|
|
|
|
child: Text(HistoryVisibility.shared
|
|
|
|
|
child: Text(
|
|
|
|
|
HistoryVisibility.shared
|
|
|
|
|
.getLocalizedString(
|
|
|
|
|
MatrixLocals(L10n.of(context)!))),
|
|
|
|
|
MatrixLocals(L10n.of(context)!),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
if (room.canChangeHistoryVisibility)
|
|
|
|
|
PopupMenuItem<HistoryVisibility>(
|
|
|
|
|
value: HistoryVisibility.worldReadable,
|
|
|
|
|
child: Text(HistoryVisibility
|
|
|
|
|
.worldReadable
|
|
|
|
|
child: Text(
|
|
|
|
|
HistoryVisibility.worldReadable
|
|
|
|
|
.getLocalizedString(
|
|
|
|
|
MatrixLocals(L10n.of(context)!))),
|
|
|
|
|
MatrixLocals(L10n.of(context)!),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
child: ListTile(
|
|
|
|
|
leading: CircleAvatar(
|
|
|
|
|
backgroundColor: Theme.of(context)
|
|
|
|
|
.scaffoldBackgroundColor,
|
|
|
|
|
backgroundColor:
|
|
|
|
|
Theme.of(context).scaffoldBackgroundColor,
|
|
|
|
|
foregroundColor: iconColor,
|
|
|
|
|
child:
|
|
|
|
|
const Icon(Icons.visibility_outlined),
|
|
|
|
|
child: const Icon(Icons.visibility_outlined),
|
|
|
|
|
),
|
|
|
|
|
title: Text(
|
|
|
|
|
L10n.of(context)!.visibilityOfTheChatHistory,
|
|
|
|
|
),
|
|
|
|
|
title: Text(L10n.of(context)!
|
|
|
|
|
.visibilityOfTheChatHistory),
|
|
|
|
|
subtitle: Text(
|
|
|
|
|
room.historyVisibility?.getLocalizedString(
|
|
|
|
|
MatrixLocals(L10n.of(context)!)) ??
|
|
|
|
|
MatrixLocals(L10n.of(context)!),
|
|
|
|
|
) ??
|
|
|
|
|
L10n.of(context)!.none,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
@ -301,9 +326,11 @@ class ChatDetailsView extends StatelessWidget {
|
|
|
|
|
PopupMenuItem<GuestAccess>(
|
|
|
|
|
value: GuestAccess.canJoin,
|
|
|
|
|
child: Text(
|
|
|
|
|
GuestAccess.canJoin
|
|
|
|
|
.getLocalizedString(MatrixLocals(
|
|
|
|
|
L10n.of(context)!)),
|
|
|
|
|
GuestAccess.canJoin.getLocalizedString(
|
|
|
|
|
MatrixLocals(
|
|
|
|
|
L10n.of(context)!,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
if (room.canChangeGuestAccess)
|
|
|
|
@ -311,8 +338,11 @@ class ChatDetailsView extends StatelessWidget {
|
|
|
|
|
value: GuestAccess.forbidden,
|
|
|
|
|
child: Text(
|
|
|
|
|
GuestAccess.forbidden
|
|
|
|
|
.getLocalizedString(MatrixLocals(
|
|
|
|
|
L10n.of(context)!)),
|
|
|
|
|
.getLocalizedString(
|
|
|
|
|
MatrixLocals(
|
|
|
|
|
L10n.of(context)!,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
@ -322,13 +352,16 @@ class ChatDetailsView extends StatelessWidget {
|
|
|
|
|
.scaffoldBackgroundColor,
|
|
|
|
|
foregroundColor: iconColor,
|
|
|
|
|
child: const Icon(
|
|
|
|
|
Icons.person_add_alt_1_outlined),
|
|
|
|
|
Icons.person_add_alt_1_outlined,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
title: Text(
|
|
|
|
|
L10n.of(context)!.areGuestsAllowedToJoin,
|
|
|
|
|
),
|
|
|
|
|
title: Text(L10n.of(context)!
|
|
|
|
|
.areGuestsAllowedToJoin),
|
|
|
|
|
subtitle: Text(
|
|
|
|
|
room.guestAccess.getLocalizedString(
|
|
|
|
|
MatrixLocals(L10n.of(context)!)),
|
|
|
|
|
MatrixLocals(L10n.of(context)!),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
@ -336,13 +369,15 @@ class ChatDetailsView extends StatelessWidget {
|
|
|
|
|
title:
|
|
|
|
|
Text(L10n.of(context)!.editChatPermissions),
|
|
|
|
|
subtitle: Text(
|
|
|
|
|
L10n.of(context)!.whoCanPerformWhichAction),
|
|
|
|
|
L10n.of(context)!.whoCanPerformWhichAction,
|
|
|
|
|
),
|
|
|
|
|
leading: CircleAvatar(
|
|
|
|
|
backgroundColor:
|
|
|
|
|
Theme.of(context).scaffoldBackgroundColor,
|
|
|
|
|
foregroundColor: iconColor,
|
|
|
|
|
child: const Icon(
|
|
|
|
|
Icons.edit_attributes_outlined),
|
|
|
|
|
Icons.edit_attributes_outlined,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
onTap: () =>
|
|
|
|
|
VRouter.of(context).to('permissions'),
|
|
|
|
@ -353,19 +388,18 @@ class ChatDetailsView extends StatelessWidget {
|
|
|
|
|
title: Text(
|
|
|
|
|
actualMembersCount > 1
|
|
|
|
|
? L10n.of(context)!.countParticipants(
|
|
|
|
|
actualMembersCount.toString())
|
|
|
|
|
actualMembersCount.toString(),
|
|
|
|
|
)
|
|
|
|
|
: L10n.of(context)!.emptyChat,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color:
|
|
|
|
|
Theme.of(context).colorScheme.secondary,
|
|
|
|
|
color: Theme.of(context).colorScheme.secondary,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
room.canInvite
|
|
|
|
|
? ListTile(
|
|
|
|
|
title:
|
|
|
|
|
Text(L10n.of(context)!.inviteContact),
|
|
|
|
|
title: Text(L10n.of(context)!.inviteContact),
|
|
|
|
|
leading: CircleAvatar(
|
|
|
|
|
backgroundColor:
|
|
|
|
|
Theme.of(context).primaryColor,
|
|
|
|
@ -373,8 +407,7 @@ class ChatDetailsView extends StatelessWidget {
|
|
|
|
|
radius: Avatar.defaultSize / 2,
|
|
|
|
|
child: const Icon(Icons.add_outlined),
|
|
|
|
|
),
|
|
|
|
|
onTap: () =>
|
|
|
|
|
VRouter.of(context).to('invite'),
|
|
|
|
|
onTap: () => VRouter.of(context).to('invite'),
|
|
|
|
|
)
|
|
|
|
|
: Container(),
|
|
|
|
|
],
|
|
|
|
@ -382,11 +415,13 @@ class ChatDetailsView extends StatelessWidget {
|
|
|
|
|
: i < controller.members!.length + 1
|
|
|
|
|
? ParticipantListItem(controller.members![i - 1])
|
|
|
|
|
: ListTile(
|
|
|
|
|
title: Text(L10n.of(context)!
|
|
|
|
|
.loadCountMoreParticipants(
|
|
|
|
|
title: Text(
|
|
|
|
|
L10n.of(context)!.loadCountMoreParticipants(
|
|
|
|
|
(actualMembersCount -
|
|
|
|
|
controller.members!.length)
|
|
|
|
|
.toString())),
|
|
|
|
|
.toString(),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
leading: CircleAvatar(
|
|
|
|
|
backgroundColor:
|
|
|
|
|
Theme.of(context).scaffoldBackgroundColor,
|
|
|
|
@ -401,6 +436,7 @@ class ChatDetailsView extends StatelessWidget {
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|