1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-11-22 21:09:21 +00:00

Hide useless fields

This commit is contained in:
Pierre HUBERT 2020-05-02 17:36:14 +02:00
parent 07adf8c2ca
commit a48e7f57a6
2 changed files with 19 additions and 4 deletions

View File

@ -12,13 +12,16 @@ class MultiChoiceEntry<T> {
final T id;
final String title;
final String subtitle;
final bool hidden;
const MultiChoiceEntry({
@required this.id,
@required this.title,
this.subtitle,
this.hidden = false,
}) : assert(id != null),
assert(title != null);
assert(title != null),
assert(hidden != null);
bool get hasSubtitle => subtitle != null;
}
@ -76,6 +79,7 @@ class __MultiChoicesEntryDialogState<T>
content: AutoSizeDialogContentWidget(
child: Column(
children: widget.choices
.where((f) => !f.hidden)
.map((f) => ListTile(
leading: Radio<T>(
groupValue: _currChoice,

View File

@ -126,9 +126,20 @@ List<MultiChoiceEntry<GroupMembershipLevel>> get _membershipLevels => [
title: tr("Member"),
subtitle: tr("Can access to all group posts")),
MultiChoiceEntry(
id: GroupMembershipLevel.PENDING, title: tr("Requested")),
MultiChoiceEntry(id: GroupMembershipLevel.INVITED, title: tr("Invited")),
MultiChoiceEntry(id: GroupMembershipLevel.VISITOR, title: tr("Visitor")),
id: GroupMembershipLevel.PENDING,
title: tr("Requested"),
hidden: true,
),
MultiChoiceEntry(
id: GroupMembershipLevel.INVITED,
title: tr("Invited"),
hidden: true,
),
MultiChoiceEntry(
id: GroupMembershipLevel.VISITOR,
title: tr("Visitor"),
hidden: true,
),
];
class _GroupMembershipTile extends StatefulWidget {