Skip to content

Commit 99a69be

Browse files
committed
feat(content): move add button to app bar
- Removed FAB - Added add button to appBar - Adjusted spacing
1 parent f0a8588 commit 99a69be

File tree

1 file changed

+19
-17
lines changed

1 file changed

+19
-17
lines changed

lib/content_management/view/content_management_page.dart

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,25 @@ class _ContentManagementPageState extends State<ContentManagementPage>
9191
],
9292
),
9393
),
94+
actions: [
95+
IconButton(
96+
icon: const Icon(Icons.add),
97+
tooltip: 'Add New Item', // Consider localizing this tooltip
98+
onPressed: () {
99+
final currentTab =
100+
context.read<ContentManagementBloc>().state.activeTab;
101+
switch (currentTab) {
102+
case ContentManagementTab.headlines:
103+
context.goNamed(Routes.createHeadlineName);
104+
case ContentManagementTab.categories:
105+
context.goNamed(Routes.createCategoryName);
106+
case ContentManagementTab.sources:
107+
context.goNamed(Routes.createSourceName);
108+
}
109+
},
110+
),
111+
const SizedBox(width: AppSpacing.md),
112+
],
94113
),
95114
body: TabBarView(
96115
controller: _tabController,
@@ -100,23 +119,6 @@ class _ContentManagementPageState extends State<ContentManagementPage>
100119
SourcesPage(),
101120
],
102121
),
103-
floatingActionButton: FloatingActionButton(
104-
onPressed: () {
105-
final currentTab = context
106-
.read<ContentManagementBloc>()
107-
.state
108-
.activeTab;
109-
switch (currentTab) {
110-
case ContentManagementTab.headlines:
111-
context.goNamed(Routes.createHeadlineName);
112-
case ContentManagementTab.categories:
113-
context.goNamed(Routes.createCategoryName);
114-
case ContentManagementTab.sources:
115-
context.goNamed(Routes.createSourceName);
116-
}
117-
},
118-
child: const Icon(Icons.add),
119-
),
120122
),
121123
);
122124
}

0 commit comments

Comments
 (0)