9c504d2c3d
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>
293 lines
7.7 KiB
Dart
293 lines
7.7 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
import '../../../core/theme/colors.dart';
|
|
|
|
/// Desktop Home Page
|
|
class HomePage extends StatelessWidget {
|
|
const HomePage({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return CustomScrollView(
|
|
slivers: [
|
|
// Header
|
|
SliverAppBar(
|
|
expandedHeight: 200,
|
|
floating: false,
|
|
pinned: true,
|
|
flexibleSpace: FlexibleSpaceBar(
|
|
title: const Text(
|
|
'Good Evening',
|
|
style: TextStyle(
|
|
color: AppColors.onBackground,
|
|
fontWeight: FontWeight.bold,
|
|
),
|
|
),
|
|
background: Container(
|
|
decoration: const BoxDecoration(
|
|
gradient: LinearGradient(
|
|
begin: Alignment.topLeft,
|
|
end: Alignment.bottomRight,
|
|
colors: [
|
|
AppColors.surface,
|
|
AppColors.surfaceVariant,
|
|
],
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
|
|
// Content sections
|
|
SliverToBoxAdapter(
|
|
child: Padding(
|
|
padding: const EdgeInsets.all(16),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
// Quick picks
|
|
const _SectionTitle(title: 'Quick Picks'),
|
|
const SizedBox(height: 12),
|
|
SizedBox(
|
|
height: 80,
|
|
child: ListView.builder(
|
|
scrollDirection: Axis.horizontal,
|
|
itemCount: 6,
|
|
itemBuilder: (context, index) {
|
|
return const _QuickPickCard();
|
|
},
|
|
),
|
|
),
|
|
|
|
const SizedBox(height: 24),
|
|
|
|
// Recently played
|
|
const _SectionTitle(title: 'Recently Played'),
|
|
const SizedBox(height: 12),
|
|
SizedBox(
|
|
height: 200,
|
|
child: ListView.builder(
|
|
scrollDirection: Axis.horizontal,
|
|
itemCount: 10,
|
|
itemBuilder: (context, index) {
|
|
return const _AlbumCard();
|
|
},
|
|
),
|
|
),
|
|
|
|
const SizedBox(height: 24),
|
|
|
|
// Made for you
|
|
const _SectionTitle(title: 'Made For You'),
|
|
const SizedBox(height: 12),
|
|
SizedBox(
|
|
height: 200,
|
|
child: ListView.builder(
|
|
scrollDirection: Axis.horizontal,
|
|
itemCount: 8,
|
|
itemBuilder: (context, index) {
|
|
return const _PlaylistCard();
|
|
},
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
],
|
|
);
|
|
}
|
|
}
|
|
|
|
class _SectionTitle extends StatelessWidget {
|
|
final String title;
|
|
|
|
const _SectionTitle({required this.title});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Text(
|
|
title,
|
|
style: Theme.of(context).textTheme.displaySmall?.copyWith(
|
|
color: AppColors.cyan,
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
class _QuickPickCard extends StatelessWidget {
|
|
const _QuickPickCard();
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Container(
|
|
width: 280,
|
|
margin: const EdgeInsets.only(right: 12),
|
|
decoration: BoxDecoration(
|
|
gradient: LinearGradient(
|
|
colors: [
|
|
AppColors.surface,
|
|
AppColors.surfaceVariant,
|
|
],
|
|
),
|
|
borderRadius: BorderRadius.circular(8),
|
|
border: Border.all(
|
|
color: AppColors.cyan.withOpacity(0.2),
|
|
width: 1,
|
|
),
|
|
),
|
|
child: Row(
|
|
children: [
|
|
Container(
|
|
width: 80,
|
|
height: 80,
|
|
decoration: BoxDecoration(
|
|
gradient: AppColors.primaryGradient,
|
|
borderRadius: const BorderRadius.only(
|
|
topLeft: Radius.circular(7),
|
|
bottomLeft: Radius.circular(7),
|
|
),
|
|
),
|
|
child: const Icon(
|
|
Icons.music_note,
|
|
color: AppColors.onBackground,
|
|
),
|
|
),
|
|
const Expanded(
|
|
child: Padding(
|
|
padding: EdgeInsets.all(12),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: [
|
|
Text(
|
|
'Playlist Name',
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.w500,
|
|
color: AppColors.onSurface,
|
|
),
|
|
),
|
|
SizedBox(height: 4),
|
|
Text(
|
|
'Description',
|
|
style: TextStyle(
|
|
fontSize: 12,
|
|
color: AppColors.muted,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
class _AlbumCard extends StatelessWidget {
|
|
const _AlbumCard();
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Container(
|
|
width: 160,
|
|
margin: const EdgeInsets.only(right: 16),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
// Album art
|
|
Container(
|
|
width: 160,
|
|
height: 160,
|
|
decoration: BoxDecoration(
|
|
gradient: AppColors.accentGradient,
|
|
borderRadius: BorderRadius.circular(8),
|
|
),
|
|
child: const Icon(
|
|
Icons.album,
|
|
size: 64,
|
|
color: AppColors.onBackground,
|
|
),
|
|
),
|
|
|
|
const SizedBox(height: 8),
|
|
|
|
// Album info
|
|
const Text(
|
|
'Album Name',
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.w500,
|
|
color: AppColors.onSurface,
|
|
),
|
|
maxLines: 1,
|
|
overflow: TextOverflow.ellipsis,
|
|
),
|
|
const Text(
|
|
'Artist Name',
|
|
style: TextStyle(
|
|
fontSize: 12,
|
|
color: AppColors.muted,
|
|
),
|
|
maxLines: 1,
|
|
overflow: TextOverflow.ellipsis,
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
class _PlaylistCard extends StatelessWidget {
|
|
const _PlaylistCard();
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Container(
|
|
width: 160,
|
|
margin: const EdgeInsets.only(right: 16),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
// Playlist art
|
|
Container(
|
|
width: 160,
|
|
height: 160,
|
|
decoration: BoxDecoration(
|
|
gradient: AppColors.fullGradient,
|
|
borderRadius: BorderRadius.circular(8),
|
|
),
|
|
child: const Icon(
|
|
Icons.playlist_play,
|
|
size: 64,
|
|
color: AppColors.onBackground,
|
|
),
|
|
),
|
|
|
|
const SizedBox(height: 8),
|
|
|
|
// Playlist info
|
|
const Text(
|
|
'Playlist Name',
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.w500,
|
|
color: AppColors.onSurface,
|
|
),
|
|
maxLines: 1,
|
|
overflow: TextOverflow.ellipsis,
|
|
),
|
|
const Text(
|
|
'Description',
|
|
style: TextStyle(
|
|
fontSize: 12,
|
|
color: AppColors.muted,
|
|
),
|
|
maxLines: 2,
|
|
overflow: TextOverflow.ellipsis,
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|