11import 'package:flutter/material.dart' ;
22import 'package:flutter_adaptive_scaffold/flutter_adaptive_scaffold.dart' ;
3+ import 'package:flutter_bloc/flutter_bloc.dart' ;
34import 'package:go_router/go_router.dart' ;
5+ import 'package:ht_dashboard/app/bloc/app_bloc.dart' ;
46import 'package:ht_dashboard/l10n/l10n.dart' ;
57import 'package:ht_dashboard/router/routes.dart' ;
68import 'package:ht_dashboard/shared/constants/app_spacing.dart' ;
@@ -34,10 +36,24 @@ class AppShell extends StatelessWidget {
3436 appBar: AppBar (
3537 title: Text (l10n.dashboard),
3638 actions: [
37- InkWell (
38- onTap: () {
39- context.goNamed (Routes .settingsName);
39+ PopupMenuButton <String >(
40+ onSelected: (value) {
41+ if (value == 'settings' ) {
42+ context.goNamed (Routes .settingsName);
43+ } else if (value == 'signOut' ) {
44+ context.read <AppBloc >().add (const AppLogoutRequested ());
45+ }
4046 },
47+ itemBuilder: (BuildContext context) => < PopupMenuEntry <String >> [
48+ PopupMenuItem <String >(
49+ value: 'settings' ,
50+ child: Text (l10n.settings),
51+ ),
52+ PopupMenuItem <String >(
53+ value: 'signOut' ,
54+ child: Text (l10n.signOut),
55+ ),
56+ ],
4157 child: Padding (
4258 padding: const EdgeInsets .all (AppSpacing .sm),
4359 child: CircleAvatar (
@@ -49,7 +65,7 @@ class AppShell extends StatelessWidget {
4965 ),
5066 ),
5167 ),
52- SizedBox (width: AppSpacing .sm),
68+ const SizedBox (width: AppSpacing .sm),
5369 ],
5470 ),
5571 body: AdaptiveScaffold (
0 commit comments