Skip to content

Commit 18cc864

Browse files
committed
feat(appshell): add appbar and user profile icon
- Added AppBar with title - Implemented user profile icon - Navigates to settings page
1 parent ddfd609 commit 18cc864

File tree

1 file changed

+47
-26
lines changed

1 file changed

+47
-26
lines changed

lib/app/view/app_shell.dart

Lines changed: 47 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import 'package:flutter/material.dart';
22
import 'package:flutter_adaptive_scaffold/flutter_adaptive_scaffold.dart';
33
import 'package:go_router/go_router.dart';
44
import 'package:ht_dashboard/l10n/l10n.dart';
5+
import 'package:ht_dashboard/router/routes.dart';
6+
import 'package:ht_dashboard/shared/constants/app_spacing.dart';
57

68
/// A responsive scaffold shell for the main application sections.
79
///
@@ -27,32 +29,51 @@ class AppShell extends StatelessWidget {
2729

2830
@override
2931
Widget build(BuildContext context) {
30-
return AdaptiveScaffold(
31-
selectedIndex: navigationShell.currentIndex,
32-
onSelectedIndexChange: _goBranch,
33-
destinations: [
34-
NavigationDestination(
35-
icon: const Icon(Icons.dashboard_outlined),
36-
selectedIcon: const Icon(Icons.dashboard),
37-
label: context.l10n.dashboard,
38-
),
39-
NavigationDestination(
40-
icon: const Icon(Icons.folder_open_outlined),
41-
selectedIcon: const Icon(Icons.folder),
42-
label: context.l10n.contentManagement,
43-
),
44-
NavigationDestination(
45-
icon: const Icon(Icons.settings_applications_outlined),
46-
selectedIcon: const Icon(Icons.settings_applications),
47-
label: context.l10n.appConfiguration,
48-
),
49-
NavigationDestination(
50-
icon: const Icon(Icons.settings_outlined),
51-
selectedIcon: const Icon(Icons.settings),
52-
label: context.l10n.settings,
53-
),
54-
],
55-
body: (_) => navigationShell,
32+
final l10n = context.l10n;
33+
return Scaffold(
34+
appBar: AppBar(
35+
title: Text(l10n.dashboard),
36+
actions: [
37+
InkWell(
38+
onTap: () {
39+
context.goNamed(Routes.settingsName);
40+
},
41+
child: Padding(
42+
padding: const EdgeInsets.all(AppSpacing.sm),
43+
child: CircleAvatar(
44+
backgroundColor: Theme.of(context).colorScheme.primaryContainer,
45+
child: Icon(
46+
Icons.person,
47+
color: Theme.of(context).colorScheme.onPrimaryContainer,
48+
),
49+
),
50+
),
51+
),
52+
SizedBox(width: AppSpacing.sm),
53+
],
54+
),
55+
body: AdaptiveScaffold(
56+
selectedIndex: navigationShell.currentIndex,
57+
onSelectedIndexChange: _goBranch,
58+
destinations: [
59+
NavigationDestination(
60+
icon: const Icon(Icons.dashboard_outlined),
61+
selectedIcon: const Icon(Icons.dashboard),
62+
label: l10n.dashboard,
63+
),
64+
NavigationDestination(
65+
icon: const Icon(Icons.folder_open_outlined),
66+
selectedIcon: const Icon(Icons.folder),
67+
label: l10n.contentManagement,
68+
),
69+
NavigationDestination(
70+
icon: const Icon(Icons.settings_applications_outlined),
71+
selectedIcon: const Icon(Icons.settings_applications),
72+
label: l10n.appConfiguration,
73+
),
74+
],
75+
body: (_) => navigationShell,
76+
),
5677
);
5778
}
5879
}

0 commit comments

Comments
 (0)