DiscoverScreen: match Thread screen AppBar (back, title, home/chat actions)
This commit is contained in:
parent
b8bd45c0f9
commit
8d52e34647
|
|
@ -13,6 +13,10 @@ import '../profile/viewable_profile_screen.dart';
|
||||||
import '../compose/compose_screen.dart';
|
import '../compose/compose_screen.dart';
|
||||||
import '../post/post_detail_screen.dart';
|
import '../post/post_detail_screen.dart';
|
||||||
import 'package:shared_preferences/shared_preferences.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
|
/// Model for discover page data
|
||||||
class DiscoverData {
|
class DiscoverData {
|
||||||
|
|
@ -278,8 +282,56 @@ class _DiscoverScreenState extends ConsumerState<DiscoverScreen> {
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: AppTheme.scaffoldBg,
|
backgroundColor: AppTheme.scaffoldBg,
|
||||||
body: SafeArea(
|
appBar: AppBar(
|
||||||
child: Column(
|
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: [
|
children: [
|
||||||
_buildHeader(),
|
_buildHeader(),
|
||||||
Expanded(
|
Expanded(
|
||||||
|
|
@ -287,7 +339,6 @@ class _DiscoverScreenState extends ConsumerState<DiscoverScreen> {
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue