feat: simplify AdminScreen and refactor ImportScreen to use TabBarView directly

This commit is contained in:
Nils-Johan Gynther
2026-04-25 08:31:42 +02:00
parent 8ea2b97c27
commit e2b7b884aa
3 changed files with 60 additions and 57 deletions
@@ -12,12 +12,7 @@ class AdminScreen extends ConsumerStatefulWidget {
class _AdminScreenState extends ConsumerState<AdminScreen> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Admin Användare'),
),
body: const AdminUsersPanel(),
);
return const AdminUsersPanel();
}
}
@@ -14,42 +14,14 @@ class ImportScreen extends StatefulWidget {
State<ImportScreen> createState() => _ImportScreenState();
}
class _ImportScreenState extends State<ImportScreen>
with SingleTickerProviderStateMixin {
late final TabController _tabController;
@override
void initState() {
super.initState();
_tabController = TabController(length: 2, vsync: this);
}
@override
void dispose() {
_tabController.dispose();
super.dispose();
}
class _ImportScreenState extends State<ImportScreen> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Importera'),
bottom: TabBar(
controller: _tabController,
tabs: const [
Tab(icon: Icon(Icons.restaurant_menu_outlined), text: 'Recept'),
Tab(icon: Icon(Icons.receipt_long_outlined), text: 'Kvitto'),
],
),
),
body: TabBarView(
controller: _tabController,
children: const [
RecipeImportTab(),
ReceiptImportTab(),
],
),
return const TabBarView(
children: [
RecipeImportTab(),
ReceiptImportTab(),
],
);
}
}