simplified code across the app and consolidated duplicated helpers
This commit is contained in:
@@ -23,19 +23,18 @@ const int _sharedItemsPageSize = 20;
|
||||
/// handled separately (split into Bilder/Videos). `location`/`deckcard` are rich
|
||||
/// objects without a downloadable file, so they have no place in this view.
|
||||
const List<_SharedCategory> _sharedCategories = [
|
||||
_SharedCategory('file', 'Dokumente', _SharedItemsLayout.list),
|
||||
_SharedCategory('voice', 'Sprachnachrichten', _SharedItemsLayout.list),
|
||||
_SharedCategory('audio', 'Audio', _SharedItemsLayout.list),
|
||||
_SharedCategory('recording', 'Aufnahmen', _SharedItemsLayout.list),
|
||||
_SharedCategory('other', 'Sonstiges', _SharedItemsLayout.list),
|
||||
_SharedCategory('file', 'Dokumente'),
|
||||
_SharedCategory('voice', 'Sprachnachrichten'),
|
||||
_SharedCategory('audio', 'Audio'),
|
||||
_SharedCategory('recording', 'Aufnahmen'),
|
||||
_SharedCategory('other', 'Sonstiges'),
|
||||
];
|
||||
|
||||
class _SharedCategory {
|
||||
final String objectType;
|
||||
final String label;
|
||||
final _SharedItemsLayout layout;
|
||||
|
||||
const _SharedCategory(this.objectType, this.label, this.layout);
|
||||
const _SharedCategory(this.objectType, this.label);
|
||||
}
|
||||
|
||||
bool _isVideoItem(GetChatResponseObject item) {
|
||||
@@ -203,7 +202,7 @@ class _SharedItemsViewState extends State<SharedItemsView>
|
||||
_SharedItemsTab(
|
||||
token: widget.room.token,
|
||||
objectType: category.objectType,
|
||||
layout: category.layout,
|
||||
layout: _SharedItemsLayout.list,
|
||||
emptyLabel: 'Keine Einträge',
|
||||
initialPage: _seedFromOverview(raw),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user