feat: Refactor admin database panel to improve tab management and enhance UI structure with dedicated tab configuration
Test Suite / test (24.15.0) (push) Has been cancelled
Test Suite / test (24.15.0) (push) Has been cancelled
This commit is contained in:
@@ -440,33 +440,6 @@ class _AdminUsersPanelState extends ConsumerState<AdminUsersPanel> {
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Card(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text('Användarkonton', style: theme.textTheme.titleMedium),
|
||||
const SizedBox(height: 8),
|
||||
Text(
|
||||
context.l10n.adminUsersDescription,
|
||||
style: theme.textTheme.bodyMedium,
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
const Wrap(
|
||||
spacing: 8,
|
||||
runSpacing: 8,
|
||||
children: [
|
||||
Chip(label: Text('Roller')),
|
||||
Chip(label: Text('Premium')),
|
||||
Chip(label: Text('Delning')),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
Wrap(
|
||||
spacing: 8,
|
||||
runSpacing: 8,
|
||||
@@ -547,73 +520,6 @@ class _AdminUsersPanelState extends ConsumerState<AdminUsersPanel> {
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Card(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(12),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
ListTile(
|
||||
contentPadding: EdgeInsets.zero,
|
||||
leading: const Icon(Icons.tune),
|
||||
title: const Text('Aktiv vy: Användare'),
|
||||
subtitle: Text(viewSummary),
|
||||
dense: true,
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Wrap(
|
||||
spacing: 8,
|
||||
runSpacing: 8,
|
||||
children: [
|
||||
if (_search.trim().isNotEmpty)
|
||||
OutlinedButton.icon(
|
||||
onPressed: () {
|
||||
_searchCtrl.clear();
|
||||
setState(() => _search = '');
|
||||
},
|
||||
icon: const Icon(Icons.search_off),
|
||||
label: const Text('Rensa sök'),
|
||||
),
|
||||
if (_filterAdminOnly || _filterPremiumOnly || _filterSharingOffOnly)
|
||||
OutlinedButton.icon(
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
_filterAdminOnly = false;
|
||||
_filterPremiumOnly = false;
|
||||
_filterSharingOffOnly = false;
|
||||
});
|
||||
},
|
||||
icon: const Icon(Icons.filter_alt_off),
|
||||
label: const Text('Rensa filter'),
|
||||
),
|
||||
if (_sort != _UserSort.newest)
|
||||
OutlinedButton.icon(
|
||||
onPressed: () => setState(() => _sort = _UserSort.newest),
|
||||
icon: const Icon(Icons.sort),
|
||||
label: const Text('Återställ sortering'),
|
||||
),
|
||||
TextButton.icon(
|
||||
onPressed: () {
|
||||
_searchCtrl.clear();
|
||||
setState(() {
|
||||
_search = '';
|
||||
_sort = _UserSort.newest;
|
||||
_filterAdminOnly = false;
|
||||
_filterPremiumOnly = false;
|
||||
_filterSharingOffOnly = false;
|
||||
});
|
||||
},
|
||||
icon: const Icon(Icons.refresh),
|
||||
label: const Text('Återställ vy'),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Text(
|
||||
'Visar ${visibleUsers.length} av ${_users.length} användare',
|
||||
style: theme.textTheme.bodySmall,
|
||||
|
||||
Reference in New Issue
Block a user