DiscoverScreen: match Thread screen AppBar (back, title, home/chat actions)

This commit is contained in:
Patrick Britton 2026-02-06 16:04:49 -06:00
parent b8bd45c0f9
commit 8d52e34647

View file

@ -13,6 +13,10 @@ import '../profile/viewable_profile_screen.dart';
import '../compose/compose_screen.dart';
import '../post/post_detail_screen.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:go_router/go_router.dart';
import 'package:google_fonts/google_fonts.dart';
import '../secure_chat/secure_chat_full_screen.dart';
import '../../providers/notification_provider.dart';
/// Model for discover page data
class DiscoverData {
@ -278,15 +282,62 @@ class _DiscoverScreenState extends ConsumerState<DiscoverScreen> {
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: AppTheme.scaffoldBg,
body: SafeArea(
child: Column(
children: [
_buildHeader(),
Expanded(
child: hasSearched ? _buildSearchResults() : _buildDiscoverContent(),
),
],
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(
'Search',
style: GoogleFonts.inter(
color: AppTheme.textPrimary,
fontSize: 18,
fontWeight: FontWeight.w700,
),
),
actions: [
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),
],
),
body: Column(
children: [
_buildHeader(),
Expanded(
child: hasSearched ? _buildSearchResults() : _buildDiscoverContent(),
),
],
),
);
}