mirror of
				https://gitlab.com/comunic/comunicmobile
				synced 2025-11-03 19:54:12 +00:00 
			
		
		
		
	Hide useless fields
This commit is contained in:
		@@ -12,13 +12,16 @@ class MultiChoiceEntry<T> {
 | 
				
			|||||||
  final T id;
 | 
					  final T id;
 | 
				
			||||||
  final String title;
 | 
					  final String title;
 | 
				
			||||||
  final String subtitle;
 | 
					  final String subtitle;
 | 
				
			||||||
 | 
					  final bool hidden;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const MultiChoiceEntry({
 | 
					  const MultiChoiceEntry({
 | 
				
			||||||
    @required this.id,
 | 
					    @required this.id,
 | 
				
			||||||
    @required this.title,
 | 
					    @required this.title,
 | 
				
			||||||
    this.subtitle,
 | 
					    this.subtitle,
 | 
				
			||||||
 | 
					    this.hidden = false,
 | 
				
			||||||
  })  : assert(id != null),
 | 
					  })  : assert(id != null),
 | 
				
			||||||
        assert(title != null);
 | 
					        assert(title != null),
 | 
				
			||||||
 | 
					        assert(hidden != null);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  bool get hasSubtitle => subtitle != null;
 | 
					  bool get hasSubtitle => subtitle != null;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -76,6 +79,7 @@ class __MultiChoicesEntryDialogState<T>
 | 
				
			|||||||
      content: AutoSizeDialogContentWidget(
 | 
					      content: AutoSizeDialogContentWidget(
 | 
				
			||||||
        child: Column(
 | 
					        child: Column(
 | 
				
			||||||
          children: widget.choices
 | 
					          children: widget.choices
 | 
				
			||||||
 | 
					              .where((f) => !f.hidden)
 | 
				
			||||||
              .map((f) => ListTile(
 | 
					              .map((f) => ListTile(
 | 
				
			||||||
                    leading: Radio<T>(
 | 
					                    leading: Radio<T>(
 | 
				
			||||||
                      groupValue: _currChoice,
 | 
					                      groupValue: _currChoice,
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -126,9 +126,20 @@ List<MultiChoiceEntry<GroupMembershipLevel>> get _membershipLevels => [
 | 
				
			|||||||
          title: tr("Member"),
 | 
					          title: tr("Member"),
 | 
				
			||||||
          subtitle: tr("Can access to all group posts")),
 | 
					          subtitle: tr("Can access to all group posts")),
 | 
				
			||||||
      MultiChoiceEntry(
 | 
					      MultiChoiceEntry(
 | 
				
			||||||
          id: GroupMembershipLevel.PENDING, title: tr("Requested")),
 | 
					        id: GroupMembershipLevel.PENDING,
 | 
				
			||||||
      MultiChoiceEntry(id: GroupMembershipLevel.INVITED, title: tr("Invited")),
 | 
					        title: tr("Requested"),
 | 
				
			||||||
      MultiChoiceEntry(id: GroupMembershipLevel.VISITOR, title: tr("Visitor")),
 | 
					        hidden: true,
 | 
				
			||||||
 | 
					      ),
 | 
				
			||||||
 | 
					      MultiChoiceEntry(
 | 
				
			||||||
 | 
					        id: GroupMembershipLevel.INVITED,
 | 
				
			||||||
 | 
					        title: tr("Invited"),
 | 
				
			||||||
 | 
					        hidden: true,
 | 
				
			||||||
 | 
					      ),
 | 
				
			||||||
 | 
					      MultiChoiceEntry(
 | 
				
			||||||
 | 
					        id: GroupMembershipLevel.VISITOR,
 | 
				
			||||||
 | 
					        title: tr("Visitor"),
 | 
				
			||||||
 | 
					        hidden: true,
 | 
				
			||||||
 | 
					      ),
 | 
				
			||||||
    ];
 | 
					    ];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class _GroupMembershipTile extends StatefulWidget {
 | 
					class _GroupMembershipTile extends StatefulWidget {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user