|
1 | 1 | 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'; |
2 | 6 |
|
3 | 7 | /// {@template content_management_page} |
4 | | -/// A placeholder page for Content Management. |
| 8 | +/// A page for Content Management with tabbed navigation for sub-sections. |
5 | 9 | /// {@endtemplate} |
6 | | -class ContentManagementPage extends StatelessWidget { |
| 10 | +class ContentManagementPage extends StatefulWidget { |
7 | 11 | /// {@macro content_management_page} |
8 | 12 | const ContentManagementPage({super.key}); |
9 | 13 |
|
| 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 | + |
10 | 34 | @override |
11 | 35 | 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 | + ], |
15 | 56 | ), |
16 | 57 | ); |
17 | 58 | } |
|
0 commit comments