NotificationsScreen: match Thread screen AppBar (back, title, home/chat actions, tab bar)

This commit is contained in:
Patrick Britton 2026-02-06 16:03:50 -06:00
parent 858d57b5b2
commit b8bd45c0f9

View file

@ -10,7 +10,10 @@ import '../../widgets/media/signed_media_image.dart';
import '../profile/viewable_profile_screen.dart';
import '../post/post_detail_screen.dart';
import 'package:go_router/go_router.dart';
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';
/// Notifications screen showing user activity
class NotificationsScreen extends ConsumerStatefulWidget {
@ -356,60 +359,84 @@ class _NotificationsScreenState extends ConsumerState<NotificationsScreen> {
length: 2,
child: Scaffold(
backgroundColor: AppTheme.scaffoldBg,
body: SafeArea(
child: Column(
children: [
// Threads-style top bar
Padding(
padding: const EdgeInsets.only(left: 4, right: 8, top: 4),
child: Row(
children: [
IconButton(
icon: Icon(Icons.arrow_back, color: AppTheme.navyBlue),
onPressed: () => context.go('/home'),
),
Text(
'Activity',
style: AppTheme.textTheme.headlineSmall?.copyWith(
fontWeight: FontWeight.bold,
),
),
const Spacer(),
if (canArchiveAll)
TextButton(
onPressed: _archiveAllNotifications,
child: Text(
'Archive All',
style: AppTheme.textTheme.labelMedium?.copyWith(
color: AppTheme.egyptianBlue,
fontWeight: FontWeight.w600,
),
),
),
],
appBar: AppBar(
backgroundColor: AppTheme.scaffoldBg,
elevation: 0,
surfaceTintColor: Colors.transparent,
leading: IconButton(
onPressed: () {
if (Navigator.of(context).canPop()) {
Navigator.of(context).pop();
} else {
context.go('/home');
}
},
icon: Icon(Icons.arrow_back, color: AppTheme.navyBlue),
),
title: Text(
'Activity',
style: GoogleFonts.inter(
color: AppTheme.textPrimary,
fontSize: 18,
fontWeight: FontWeight.w700,
),
),
actions: [
if (canArchiveAll)
TextButton(
onPressed: _archiveAllNotifications,
child: Text(
'Archive All',
style: AppTheme.textTheme.labelMedium?.copyWith(
color: AppTheme.egyptianBlue,
fontWeight: FontWeight.w600,
),
),
),
// Filter tabs
TabBar(
onTap: (index) {
if (index != _activeTabIndex) {
setState(() {
_activeTabIndex = index;
});
_loadNotifications(refresh: true);
}
},
indicatorColor: AppTheme.egyptianBlue,
labelColor: AppTheme.egyptianBlue,
unselectedLabelColor: AppTheme.egyptianBlue.withOpacity(0.5),
tabs: const [
Tab(text: 'Active'),
Tab(text: 'Archived'),
],
IconButton(
onPressed: () => context.go('/home'),
icon: Icon(Icons.home_outlined, color: AppTheme.navyBlue),
),
IconButton(
onPressed: () => Navigator.of(context, rootNavigator: true).push(
MaterialPageRoute(
builder: (_) => const SecureChatFullScreen(),
fullscreenDialog: true,
),
),
// Content
Expanded(
child: _error != null
icon: Consumer(
builder: (context, ref, child) {
final badge = ref.watch(currentBadgeProvider);
return Badge(
label: Text(badge.messageCount.toString()),
isLabelVisible: badge.messageCount > 0,
backgroundColor: AppTheme.brightNavy,
child: Icon(Icons.chat_bubble_outline, color: AppTheme.navyBlue),
);
},
),
),
const SizedBox(width: 8),
],
bottom: TabBar(
onTap: (index) {
if (index != _activeTabIndex) {
setState(() {
_activeTabIndex = index;
});
_loadNotifications(refresh: true);
}
},
indicatorColor: AppTheme.egyptianBlue,
labelColor: AppTheme.egyptianBlue,
unselectedLabelColor: AppTheme.egyptianBlue.withOpacity(0.5),
tabs: const [
Tab(text: 'Active'),
Tab(text: 'Archived'),
],
),
),
body: _error != null
? _ErrorState(
message: _error!,
onRetry: () => _loadNotifications(refresh: true),
@ -483,10 +510,6 @@ class _NotificationsScreenState extends ConsumerState<NotificationsScreen> {
},
),
),
),
],
),
),
),
);
}