84ccabe2fe
Test Suite / test (24.15.0) (push) Has been cancelled
- Implemented moveInventoryItemToPantry method in InventoryRepository to facilitate moving items from inventory to pantry. - Enhanced InventoryScreen with a new header section providing context about the inventory. - Added a button in SwipeableInventoryTile to move items to pantry with appropriate error handling. - Introduced movePantryItemToInventory method in PantryRepository to support moving items back to inventory. - Refactored PantryScreen to rename _addToInventory to _moveToInventory for clarity and updated UI to reflect changes. - Added AdminPantryItem model to represent pantry items in the admin panel. - Created AdminPantryPanel for managing pantry items, including moving items to inventory and listing users. - Developed AdminPrivateProductsPanel for managing private products, allowing promotion to global products.
81 lines
2.7 KiB
Dart
81 lines
2.7 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
import '../../../core/l10n/l10n.dart';
|
|
import 'admin_database_panel.dart';
|
|
import 'admin_users_panel.dart';
|
|
|
|
class AdminScreen extends ConsumerStatefulWidget {
|
|
const AdminScreen({super.key});
|
|
|
|
@override
|
|
ConsumerState<AdminScreen> createState() => _AdminScreenState();
|
|
}
|
|
|
|
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),
|
|
const Wrap(
|
|
spacing: 8,
|
|
runSpacing: 8,
|
|
children: [
|
|
Chip(label: Text('Konton')),
|
|
Chip(label: Text('Databas')),
|
|
Chip(label: Text('Privat + globalt')),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
),
|
|
Material(
|
|
color: Theme.of(context).colorScheme.surface,
|
|
child: TabBar(
|
|
isScrollable: true,
|
|
tabs: [
|
|
Tab(text: context.l10n.profileUsersTab, icon: const Icon(Icons.people_outline)),
|
|
const Tab(text: 'Databas', icon: Icon(Icons.storage_outlined)),
|
|
],
|
|
),
|
|
),
|
|
const Expanded(
|
|
child: TabBarView(
|
|
children: [
|
|
Padding(
|
|
padding: EdgeInsets.fromLTRB(12, 12, 12, 8),
|
|
child: AdminUsersPanel(embedded: true),
|
|
),
|
|
Padding(
|
|
padding: EdgeInsets.fromLTRB(12, 12, 12, 8),
|
|
child: AdminDatabasePanel(embedded: true),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|