Skip to content

Commit 54668e4

Browse files
committed
feat(content): implement tabbed content management
- Added Headlines tab - Added Categories tab - Added Sources tab - Implemented tab controller
1 parent ba03899 commit 54668e4

File tree

1 file changed

+46
-5
lines changed

1 file changed

+46
-5
lines changed

lib/content_management/view/content_management_page.dart

Lines changed: 46 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,58 @@
11
import 'package:flutter/material.dart';
2+
import 'package:ht_dashboard/content_management/view/categories_page.dart';
3+
import 'package:ht_dashboard/content_management/view/headlines_page.dart';
4+
import 'package:ht_dashboard/content_management/view/sources_page.dart';
5+
import 'package:ht_dashboard/l10n/l10n.dart';
26

37
/// {@template content_management_page}
4-
/// A placeholder page for Content Management.
8+
/// A page for Content Management with tabbed navigation for sub-sections.
59
/// {@endtemplate}
6-
class ContentManagementPage extends StatelessWidget {
10+
class ContentManagementPage extends StatefulWidget {
711
/// {@macro content_management_page}
812
const ContentManagementPage({super.key});
913

14+
@override
15+
State<ContentManagementPage> createState() => _ContentManagementPageState();
16+
}
17+
18+
class _ContentManagementPageState extends State<ContentManagementPage>
19+
with SingleTickerProviderStateMixin {
20+
late TabController _tabController;
21+
22+
@override
23+
void initState() {
24+
super.initState();
25+
_tabController = TabController(length: 3, vsync: this);
26+
}
27+
28+
@override
29+
void dispose() {
30+
_tabController.dispose();
31+
super.dispose();
32+
}
33+
1034
@override
1135
Widget build(BuildContext context) {
12-
return const Scaffold(
13-
body: Center(
14-
child: Text('Content Management Page'),
36+
final l10n = context.l10n;
37+
return Scaffold(
38+
appBar: AppBar(
39+
title: Text(l10n.contentManagement),
40+
bottom: TabBar(
41+
controller: _tabController,
42+
tabs: [
43+
Tab(text: l10n.headlines),
44+
Tab(text: l10n.categories),
45+
Tab(text: l10n.sources),
46+
],
47+
),
48+
),
49+
body: TabBarView(
50+
controller: _tabController,
51+
children: const [
52+
HeadlinesPage(),
53+
CategoriesPage(),
54+
SourcesPage(),
55+
],
1556
),
1657
);
1758
}

0 commit comments

Comments
 (0)