@@ -2,6 +2,8 @@ import 'package:flutter/material.dart';
2
2
import 'package:flutter_adaptive_scaffold/flutter_adaptive_scaffold.dart' ;
3
3
import 'package:go_router/go_router.dart' ;
4
4
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' ;
5
7
6
8
/// A responsive scaffold shell for the main application sections.
7
9
///
@@ -27,32 +29,51 @@ class AppShell extends StatelessWidget {
27
29
28
30
@override
29
31
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
+ ),
56
77
);
57
78
}
58
79
}
0 commit comments