mirror of
https://gitlab.com/comunic/comunicmobile
synced 2024-11-22 12:59:21 +00:00
Display group members to all users if it is public
This commit is contained in:
parent
6d1fc388d0
commit
07b42df06a
@ -58,15 +58,14 @@ class _AuthorizedGroupPageScreenState
|
||||
_GroupPageTab(
|
||||
widget: (c) => AboutGroupSection(group: _group),
|
||||
label: tr("About"),
|
||||
),
|
||||
|
||||
_GroupPageTab(
|
||||
widget: (c) => GroupMembersSection(groupID: _group.id),
|
||||
label: tr("Members"),
|
||||
visible: _group.isAtLeastModerator || _group.isMembersListPublic,
|
||||
)
|
||||
]..addAll(_group.isAtLeastModerator
|
||||
? [
|
||||
_GroupPageTab(
|
||||
widget: (c) => GroupMembersSection(groupID: _group.id),
|
||||
label: tr("Members"),
|
||||
),
|
||||
]
|
||||
: []);
|
||||
].where((element) => element.visible).toList();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@ -173,12 +172,15 @@ class _AuthorizedGroupPageScreenState
|
||||
|
||||
class _GroupPageTab {
|
||||
final WidgetBuilder widget;
|
||||
final bool visible;
|
||||
final String label;
|
||||
|
||||
const _GroupPageTab({
|
||||
@required this.widget,
|
||||
this.visible = true,
|
||||
@required this.label,
|
||||
}) : assert(widget != null),
|
||||
assert(visible != null),
|
||||
assert(label != null);
|
||||
|
||||
Tab get tab => Tab(text: label);
|
||||
|
@ -58,7 +58,7 @@ class _GroupMembersSectionState extends State<GroupMembersSection> {
|
||||
return Stack(
|
||||
children: [
|
||||
ListView(children: _members.map(_buildGroupMemberTile).toList()),
|
||||
_buildInvitationFAB()
|
||||
_group.isAtLeastModerator ? _buildInvitationFAB() : Container()
|
||||
],
|
||||
);
|
||||
}
|
||||
@ -172,7 +172,7 @@ class __GroupMembershipTileState extends State<_GroupMembershipTile> {
|
||||
subtitle: Text(_membershipLevels
|
||||
.firstWhere((f) => f.id == widget.membership.level)
|
||||
.title),
|
||||
trailing: _buildTrailing(),
|
||||
trailing: widget.group.isAtLeastModerator ? _buildTrailing() : null,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -52,7 +52,7 @@ class _GroupMembershipWidgetState extends SafeState<GroupMembershipWidget> {
|
||||
return _buildVisitorState();
|
||||
|
||||
default:
|
||||
throw Exception("Unkonwn group pmembership level state: $_level");
|
||||
throw Exception("Unknown group membership level state: $_level");
|
||||
}
|
||||
}
|
||||
|
||||
@ -140,7 +140,6 @@ class _GroupMembershipWidgetState extends SafeState<GroupMembershipWidget> {
|
||||
return RichText(
|
||||
text: TextSpan(
|
||||
text: tr("Request membership"),
|
||||
style: TextStyle(color: Colors.blue),
|
||||
recognizer: TapGestureRecognizer()
|
||||
..onTap = () => _requestMembership()),
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user