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,25 +359,29 @@ 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(
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),
onPressed: () => context.go('/home'),
),
Text(
title: Text(
'Activity',
style: AppTheme.textTheme.headlineSmall?.copyWith(
fontWeight: FontWeight.bold,
style: GoogleFonts.inter(
color: AppTheme.textPrimary,
fontSize: 18,
fontWeight: FontWeight.w700,
),
),
const Spacer(),
actions: [
if (canArchiveAll)
TextButton(
onPressed: _archiveAllNotifications,
@ -386,11 +393,32 @@ class _NotificationsScreenState extends ConsumerState<NotificationsScreen> {
),
),
),
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,
),
),
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),
],
),
),
// Filter tabs
TabBar(
bottom: TabBar(
onTap: (index) {
if (index != _activeTabIndex) {
setState(() {
@ -407,9 +435,8 @@ class _NotificationsScreenState extends ConsumerState<NotificationsScreen> {
Tab(text: 'Archived'),
],
),
// Content
Expanded(
child: _error != null
),
body: _error != null
? _ErrorState(
message: _error!,
onRetry: () => _loadNotifications(refresh: true),
@ -484,10 +511,6 @@ class _NotificationsScreenState extends ConsumerState<NotificationsScreen> {
),
),
),
],
),
),
),
);
}
}