NotificationsScreen + DiscoverScreen: match Thread screen AppBar (back, home/search/chat actions, full-page push)
This commit is contained in:
parent
8d52e34647
commit
72264c3044
|
|
@ -94,16 +94,6 @@ class AppRoutes {
|
||||||
GoRoute(
|
GoRoute(
|
||||||
path: homeAlias,
|
path: homeAlias,
|
||||||
builder: (_, __) => const FeedPersonalScreen(),
|
builder: (_, __) => const FeedPersonalScreen(),
|
||||||
routes: [
|
|
||||||
GoRoute(
|
|
||||||
path: 'notifications',
|
|
||||||
builder: (_, __) => const NotificationsScreen(),
|
|
||||||
),
|
|
||||||
GoRoute(
|
|
||||||
path: 'discover',
|
|
||||||
builder: (_, __) => const DiscoverScreen(),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -256,7 +256,13 @@ class _HomeShellState extends ConsumerState<HomeShell> with WidgetsBindingObserv
|
||||||
IconButton(
|
IconButton(
|
||||||
icon: Icon(Icons.search, color: AppTheme.navyBlue),
|
icon: Icon(Icons.search, color: AppTheme.navyBlue),
|
||||||
tooltip: 'Discover',
|
tooltip: 'Discover',
|
||||||
onPressed: () => context.go('/home/discover'),
|
onPressed: () {
|
||||||
|
Navigator.of(context, rootNavigator: true).push(
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (_) => const DiscoverScreen(),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
IconButton(
|
IconButton(
|
||||||
icon: Consumer(
|
icon: Consumer(
|
||||||
|
|
@ -293,7 +299,13 @@ class _HomeShellState extends ConsumerState<HomeShell> with WidgetsBindingObserv
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
tooltip: 'Notifications',
|
tooltip: 'Notifications',
|
||||||
onPressed: () => context.go('/home/notifications'),
|
onPressed: () {
|
||||||
|
Navigator.of(context, rootNavigator: true).push(
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (_) => const NotificationsScreen(),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
const SizedBox(width: 4),
|
const SizedBox(width: 4),
|
||||||
],
|
],
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ import 'package:google_fonts/google_fonts.dart';
|
||||||
import '../../services/notification_service.dart';
|
import '../../services/notification_service.dart';
|
||||||
import '../../providers/notification_provider.dart';
|
import '../../providers/notification_provider.dart';
|
||||||
import '../secure_chat/secure_chat_full_screen.dart';
|
import '../secure_chat/secure_chat_full_screen.dart';
|
||||||
|
import '../discover/discover_screen.dart';
|
||||||
|
|
||||||
/// Notifications screen showing user activity
|
/// Notifications screen showing user activity
|
||||||
class NotificationsScreen extends ConsumerStatefulWidget {
|
class NotificationsScreen extends ConsumerStatefulWidget {
|
||||||
|
|
@ -382,23 +383,23 @@ class _NotificationsScreenState extends ConsumerState<NotificationsScreen> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
actions: [
|
actions: [
|
||||||
if (canArchiveAll)
|
|
||||||
TextButton(
|
|
||||||
onPressed: _archiveAllNotifications,
|
|
||||||
child: Text(
|
|
||||||
'Archive All',
|
|
||||||
style: AppTheme.textTheme.labelMedium?.copyWith(
|
|
||||||
color: AppTheme.egyptianBlue,
|
|
||||||
fontWeight: FontWeight.w600,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
IconButton(
|
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),
|
icon: Icon(Icons.home_outlined, color: AppTheme.navyBlue),
|
||||||
),
|
),
|
||||||
IconButton(
|
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(
|
MaterialPageRoute(
|
||||||
builder: (_) => const SecureChatFullScreen(),
|
builder: (_) => const SecureChatFullScreen(),
|
||||||
fullscreenDialog: true,
|
fullscreenDialog: true,
|
||||||
|
|
@ -443,7 +444,26 @@ class _NotificationsScreenState extends ConsumerState<NotificationsScreen> {
|
||||||
)
|
)
|
||||||
: _notifications.isEmpty && !_isLoading
|
: _notifications.isEmpty && !_isLoading
|
||||||
? const _EmptyState()
|
? 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),
|
onRefresh: () => _loadNotifications(refresh: true),
|
||||||
child: ListView.builder(
|
child: ListView.builder(
|
||||||
itemCount: _notifications.length + (_hasMore ? 1 : 0),
|
itemCount: _notifications.length + (_hasMore ? 1 : 0),
|
||||||
|
|
@ -510,6 +530,9 @@ class _NotificationsScreenState extends ConsumerState<NotificationsScreen> {
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
)),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue