Files
AudiOhm/frontend/lib/presentation/providers/navigation_provider.dart
T
root a89c7894cf Initial commit: AudiOhm - Alternative Spotify avec streaming YouTube
Backend:
- FastAPI avec PostgreSQL et Redis
- Authentification JWT complète
- API REST pour musique, playlists, recherche
- Streaming audio via yt-dlp
- SQLAlchemy 2.0 async

Frontend:
- Flutter avec thème néon cyberpunk
- State management Riverpod
- Layout adaptatif desktop/mobile
- Lecteur audio avec mini-player

Infrastructure:
- Docker Compose (PostgreSQL + Redis)
- Scripts d'installation automatisés
- Scripts de build pour exécutables

Fichiers ajoutés:
- BUILD_CLIENT_*.bat/sh: Scripts de compilation
- BUILD_CLIENT_README.md: Documentation compilation
- CHECK_FLUTTER.sh: Vérificateur d'environnement
- requirements.txt mis à jour pour Python 3.13
- Modèles SQLAlchemy corrigés (metadata -> extra_metadata)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-18 20:08:36 +00: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);