835592f073
Mechanical sweep across 30 files: every Material Icons.* replaced with the signed-off Lucide equivalent + a flutter_lucide import per file. Zero Material Icons.* remain in lib/; no unused imports. Judgment-call mappings: album->disc_3, library_music->library_big, playlist_play->list_video, graphic_eq->audio_lines, system_update->download, restore->archive_restore, download_done->circle_check_big. track_actions_sheet like menu row: collapsed `liked ? favorite : favorite_border` to a single LucideIcons.heart (the row's Like/Unlike text label conveys state). Icon-only LikeButton + the notification keep the filled-vs-outline shape per the design decision. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
65 lines
2.4 KiB
Dart
65 lines
2.4 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_lucide/flutter_lucide.dart';
|
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
import 'package:go_router/go_router.dart';
|
|
|
|
import '../../auth/auth_provider.dart';
|
|
import '../../theme/theme_extension.dart';
|
|
|
|
/// Shared AppBar `actions` for top-level screens. Renders Home / Library /
|
|
/// Search as primary icons (suppressing the icon for [currentRoute]) plus
|
|
/// a kebab overflow with Playlists / Discover / Settings and (for admins)
|
|
/// Admin.
|
|
class MainAppBarActions extends ConsumerWidget {
|
|
const MainAppBarActions({super.key, required this.currentRoute});
|
|
|
|
final String currentRoute;
|
|
|
|
@override
|
|
Widget build(BuildContext context, WidgetRef ref) {
|
|
final fs = Theme.of(context).extension<FabledSwordTheme>()!;
|
|
final user = ref.watch(authControllerProvider).value;
|
|
final isAdmin = user?.isAdmin ?? false;
|
|
|
|
return Row(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
if (currentRoute != '/home')
|
|
IconButton(
|
|
key: const Key('app_bar_home'),
|
|
icon: Icon(LucideIcons.house, color: fs.parchment),
|
|
tooltip: 'Home',
|
|
onPressed: () => context.go('/home'),
|
|
),
|
|
if (currentRoute != '/library')
|
|
IconButton(
|
|
key: const Key('app_bar_library'),
|
|
icon: Icon(LucideIcons.library_big, color: fs.parchment),
|
|
tooltip: 'Library',
|
|
onPressed: () => context.push('/library'),
|
|
),
|
|
if (currentRoute != '/search')
|
|
IconButton(
|
|
key: const Key('app_bar_search'),
|
|
icon: Icon(LucideIcons.search, color: fs.parchment),
|
|
tooltip: 'Search',
|
|
onPressed: () => context.push('/search'),
|
|
),
|
|
PopupMenuButton<String>(
|
|
key: const Key('app_bar_overflow'),
|
|
icon: Icon(LucideIcons.ellipsis_vertical, color: fs.parchment),
|
|
tooltip: 'More',
|
|
onSelected: (route) => context.push(route),
|
|
itemBuilder: (_) => [
|
|
const PopupMenuItem(value: '/playlists', child: Text('Playlists')),
|
|
const PopupMenuItem(value: '/discover', child: Text('Discover')),
|
|
const PopupMenuItem(value: '/settings', child: Text('Settings')),
|
|
if (isAdmin)
|
|
const PopupMenuItem(value: '/admin', child: Text('Admin')),
|
|
],
|
|
),
|
|
],
|
|
);
|
|
}
|
|
}
|