Files
AudiOhm/frontend/lib/presentation/providers/navigation_provider.dart
T
feldenr 9c504d2c3d 🎉 Initial commit: AudiOhm - Alternative à Spotify avec streaming YouTube
Features:
- Frontend Flutter avec thème néon cyberpunk
- Backend FastAPI avec streaming YouTube
- Base de données PostgreSQL + Redis
- Authentification JWT complète
- Recherche multi-source (DB + YouTube)
- Playlists CRUD avec drag & drop
- Queue management
- Settings avec audio quality
- Interface adaptative (Desktop + Mobile)

Tech Stack:
- Frontend: Flutter 3.2+, Riverpod
- Backend: Python 3.11+, FastAPI
- Database: PostgreSQL 15+
- Cache: Redis 7+
- Streaming: yt-dlp + FFmpeg

🚀 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-18 17:08:59 +01:00

42 lines
1014 B
Dart

import 'package:flutter_riverpod/flutter_riverpod.dart';
/// Navigation state
class NavigationState {
final String currentPage;
const NavigationState({
this.currentPage = 'home',
});
NavigationState copyWith({String? currentPage}) {
return NavigationState(
currentPage: currentPage ?? this.currentPage,
);
}
}
/// Navigation notifier
class NavigationNotifier extends StateNotifier<NavigationState> {
NavigationNotifier() : super(const NavigationState());
void navigateTo(String page) {
if (state.currentPage != page) {
state = state.copyWith(currentPage: page);
}
}
void goBack() {
// Simple navigation: always go to home
state = const NavigationState(currentPage: 'home');
}
}
/// Navigation provider
final navigationProvider =
StateNotifierProvider<NavigationNotifier, NavigationState>((ref) {
return NavigationNotifier();
});
/// Current page provider
final currentPageProvider = navigationProvider.select((state) => state.currentPage);