NotificationsScreen + DiscoverScreen: match Thread screen AppBar (back, home/search/chat actions, full-page push)

This commit is contained in:
Patrick Britton 2026-02-06 16:12:12 -06:00
parent 8d52e34647
commit 72264c3044
3 changed files with 51 additions and 26 deletions

View file

@ -94,16 +94,6 @@ class AppRoutes {
GoRoute(
path: homeAlias,
builder: (_, __) => const FeedPersonalScreen(),
routes: [
GoRoute(
path: 'notifications',
builder: (_, __) => const NotificationsScreen(),
),
GoRoute(
path: 'discover',
builder: (_, __) => const DiscoverScreen(),
),
],
),
],
),

View file

@ -256,7 +256,13 @@ class _HomeShellState extends ConsumerState<HomeShell> with WidgetsBindingObserv
IconButton(
icon: Icon(Icons.search, color: AppTheme.navyBlue),
tooltip: 'Discover',
onPressed: () => context.go('/home/discover'),
onPressed: () {
Navigator.of(context, rootNavigator: true).push(
MaterialPageRoute(
builder: (_) => const DiscoverScreen(),
),
);
},
),
IconButton(
icon: Consumer(
@ -293,7 +299,13 @@ class _HomeShellState extends ConsumerState<HomeShell> with WidgetsBindingObserv
},
),
tooltip: 'Notifications',
onPressed: () => context.go('/home/notifications'),
onPressed: () {
Navigator.of(context, rootNavigator: true).push(
MaterialPageRoute(
builder: (_) => const NotificationsScreen(),
),
);
},
),
const SizedBox(width: 4),
],

View file

@ -14,6 +14,7 @@ import 'package:google_fonts/google_fonts.dart';
import '../../services/notification_service.dart';
import '../../providers/notification_provider.dart';
import '../secure_chat/secure_chat_full_screen.dart';
import '../discover/discover_screen.dart';
/// Notifications screen showing user activity
class NotificationsScreen extends ConsumerStatefulWidget {
@ -382,23 +383,23 @@ class _NotificationsScreenState extends ConsumerState<NotificationsScreen> {
),
),
actions: [
if (canArchiveAll)
TextButton(
onPressed: _archiveAllNotifications,
child: Text(
'Archive All',
style: AppTheme.textTheme.labelMedium?.copyWith(
color: AppTheme.egyptianBlue,
fontWeight: FontWeight.w600,
),
),
),
IconButton(
onPressed: () => context.go('/home'),
onPressed: () {
Navigator.of(context).pop();
// Small delay so pop completes before navigating
},
icon: Icon(Icons.home_outlined, color: AppTheme.navyBlue),
),
IconButton(
onPressed: () => Navigator.of(context, rootNavigator: true).push(
onPressed: () {
Navigator.of(context).pushReplacement(
MaterialPageRoute(builder: (_) => const DiscoverScreen()),
);
},
icon: Icon(Icons.search, color: AppTheme.navyBlue),
),
IconButton(
onPressed: () => Navigator.of(context).pushReplacement(
MaterialPageRoute(
builder: (_) => const SecureChatFullScreen(),
fullscreenDialog: true,
@ -443,7 +444,26 @@ class _NotificationsScreenState extends ConsumerState<NotificationsScreen> {
)
: _notifications.isEmpty && !_isLoading
? const _EmptyState()
: RefreshIndicator(
: Column(
children: [
if (canArchiveAll)
Align(
alignment: Alignment.centerRight,
child: Padding(
padding: const EdgeInsets.only(right: 8, top: 4),
child: TextButton(
onPressed: _archiveAllNotifications,
child: Text(
'Archive All',
style: AppTheme.textTheme.labelMedium?.copyWith(
color: AppTheme.egyptianBlue,
fontWeight: FontWeight.w600,
),
),
),
),
),
Expanded(child: RefreshIndicator(
onRefresh: () => _loadNotifications(refresh: true),
child: ListView.builder(
itemCount: _notifications.length + (_hasMore ? 1 : 0),
@ -510,6 +530,9 @@ class _NotificationsScreenState extends ConsumerState<NotificationsScreen> {
},
),
),
)),
],
),
),
);
}