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

This commit is contained in:
Nils-Johan Gynther
2026-05-11 09:55:52 +02:00
parent 1d2c3c9032
commit 06492ff099
3 changed files with 110 additions and 342 deletions
@@ -14,53 +14,15 @@ class AdminScreen extends ConsumerStatefulWidget {
class _AdminScreenState extends ConsumerState<AdminScreen> {
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
return DefaultTabController(
length: 2,
child: Column(
children: [
Padding(
padding: const EdgeInsets.fromLTRB(12, 12, 12, 8),
child: Card(
child: Padding(
padding: const EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('Admin', style: theme.textTheme.titleMedium),
const SizedBox(height: 8),
Text(
'Användare är för konton och roller. Databas är arbetsytan för inventarie, baslager, produkter, alias och importflöden.',
style: theme.textTheme.bodyMedium,
),
const SizedBox(height: 8),
Wrap(
spacing: 8,
runSpacing: 8,
children: [
ActionChip(
label: const Text('Konton'),
onPressed: () => DefaultTabController.of(context).animateTo(0),
),
ActionChip(
label: const Text('Databas'),
onPressed: () => DefaultTabController.of(context).animateTo(1),
),
ActionChip(
label: const Text('Privat + globalt'),
onPressed: () => DefaultTabController.of(context).animateTo(1),
),
],
),
],
),
),
),
),
Material(
color: Theme.of(context).colorScheme.surface,
child: TabBar(
isScrollable: true,
padding: const EdgeInsets.symmetric(horizontal: 12),
tabs: [
Tab(text: context.l10n.profileUsersTab, icon: const Icon(Icons.people_outline)),
const Tab(text: 'Databas', icon: Icon(Icons.storage_outlined)),
@@ -71,11 +33,11 @@ class _AdminScreenState extends ConsumerState<AdminScreen> {
child: TabBarView(
children: [
Padding(
padding: EdgeInsets.fromLTRB(12, 12, 12, 8),
padding: EdgeInsets.fromLTRB(12, 8, 12, 8),
child: AdminUsersPanel(embedded: true),
),
Padding(
padding: EdgeInsets.fromLTRB(12, 12, 12, 8),
padding: EdgeInsets.fromLTRB(12, 8, 12, 8),
child: AdminDatabasePanel(embedded: true),
),
],