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>
258 lines
7.9 KiB
Dart
258 lines
7.9 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'colors.dart';
|
|
import 'text_styles.dart';
|
|
|
|
/// App Theme - Neon Cyberpunk
|
|
class AppTheme {
|
|
AppTheme._();
|
|
|
|
// Light theme (not used, keeping for completeness)
|
|
static ThemeData get lightTheme => ThemeData(
|
|
useMaterial3: true,
|
|
brightness: Brightness.light,
|
|
colorScheme: _lightColorScheme,
|
|
textTheme: _textTheme,
|
|
fontFamily: AppTextStyles.fontFamily,
|
|
);
|
|
|
|
// Dark theme (main theme)
|
|
static ThemeData get darkTheme => ThemeData(
|
|
useMaterial3: true,
|
|
brightness: Brightness.dark,
|
|
colorScheme: _darkColorScheme,
|
|
textTheme: _textTheme,
|
|
fontFamily: AppTextStyles.fontFamily,
|
|
scaffoldBackgroundColor: AppColors.primary,
|
|
appBarTheme: _appBarTheme,
|
|
cardTheme: _cardTheme,
|
|
elevatedButtonTheme: _elevatedButtonTheme,
|
|
textButtonTheme: _textButtonTheme,
|
|
outlinedButtonTheme: _outlinedButtonTheme,
|
|
inputDecorationTheme: _inputDecorationTheme,
|
|
floatingActionButtonTheme: _floatingActionButtonTheme,
|
|
bottomNavigationBarTheme: _bottomNavigationBarTheme,
|
|
navigationBarTheme: _navigationBarTheme,
|
|
sliderTheme: _sliderTheme,
|
|
progressIndicatorTheme: _progressIndicatorTheme,
|
|
);
|
|
|
|
// Color Schemes
|
|
static const ColorScheme _lightColorScheme = ColorScheme.light(
|
|
primary: AppColors.cyan,
|
|
secondary: AppColors.violet,
|
|
tertiary: AppColors.rose,
|
|
surface: AppColors.surface,
|
|
error: AppColors.error,
|
|
onPrimary: AppColors.primary,
|
|
onSecondary: AppColors.primary,
|
|
onSurface: AppColors.onSurface,
|
|
onError: Colors.white,
|
|
);
|
|
|
|
static const ColorScheme _darkColorScheme = ColorScheme.dark(
|
|
primary: AppColors.cyan,
|
|
secondary: AppColors.violet,
|
|
tertiary: AppColors.rose,
|
|
surface: AppColors.surface,
|
|
error: AppColors.error,
|
|
onPrimary: AppColors.primary,
|
|
onSecondary: AppColors.primary,
|
|
onSurface: AppColors.onSurface,
|
|
onError: Colors.white,
|
|
);
|
|
|
|
// Text Theme
|
|
static const TextTheme _textTheme = TextTheme(
|
|
displayLarge: AppTextStyles.h1,
|
|
displayMedium: AppTextStyles.h2,
|
|
displaySmall: AppTextStyles.h3,
|
|
bodyLarge: AppTextStyles.bodyLarge,
|
|
bodyMedium: AppTextStyles.body,
|
|
bodySmall: AppTextStyles.bodySmall,
|
|
labelLarge: AppTextStyles.button,
|
|
labelMedium: AppTextStyles.label,
|
|
labelSmall: AppTextStyles.caption,
|
|
);
|
|
|
|
// AppBar Theme
|
|
static const AppBarTheme _appBarTheme = AppBarTheme(
|
|
elevation: 0,
|
|
centerTitle: false,
|
|
backgroundColor: Colors.transparent,
|
|
foregroundColor: AppColors.onBackground,
|
|
titleTextStyle: AppTextStyles.h2,
|
|
iconTheme: IconThemeData(
|
|
color: AppColors.onSurface,
|
|
),
|
|
);
|
|
|
|
// Card Theme
|
|
static CardTheme _cardTheme = CardTheme(
|
|
elevation: 0,
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.circular(16),
|
|
side: BorderSide(
|
|
color: AppColors.cyan.withOpacity(0.15),
|
|
width: 1,
|
|
),
|
|
),
|
|
color: AppColors.surface,
|
|
margin: const EdgeInsets.all(8),
|
|
);
|
|
|
|
// Elevated Button Theme
|
|
static ElevatedButtonThemeData _elevatedButtonTheme =
|
|
ElevatedButtonThemeData(
|
|
style: ElevatedButton.styleFrom(
|
|
elevation: 0,
|
|
padding: const EdgeInsets.symmetric(horizontal: 28, vertical: 14),
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.circular(8),
|
|
),
|
|
backgroundColor: AppColors.cyan,
|
|
foregroundColor: AppColors.primary,
|
|
textStyle: AppTextStyles.button,
|
|
shadowColor: AppColors.cyan.withOpacity(0.4),
|
|
).copyWith(
|
|
overlayColor: MaterialStateProperty.resolveWith((states) {
|
|
if (states.contains(MaterialState.pressed)) {
|
|
return AppColors.cyan.withOpacity(0.2);
|
|
}
|
|
if (states.contains(MaterialState.hovered)) {
|
|
return AppColors.cyan.withOpacity(0.1);
|
|
}
|
|
return null;
|
|
}),
|
|
),
|
|
);
|
|
|
|
// Text Button Theme
|
|
static TextButtonThemeData _textButtonTheme = TextButtonThemeData(
|
|
style: TextButton.styleFrom(
|
|
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 14),
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.circular(8),
|
|
),
|
|
foregroundColor: AppColors.cyan,
|
|
textStyle: AppTextStyles.button,
|
|
).copyWith(
|
|
side: MaterialStateProperty.resolveWith((states) {
|
|
if (states.contains(MaterialState.pressed)) {
|
|
return BorderSide(color: AppColors.cyan, width: 2);
|
|
}
|
|
return BorderSide(
|
|
color: AppColors.cyan.withOpacity(0.5),
|
|
width: 1.5,
|
|
);
|
|
}),
|
|
),
|
|
);
|
|
|
|
// Outlined Button Theme
|
|
static OutlinedButtonThemeData _outlinedButtonTheme =
|
|
OutlinedButtonThemeData(
|
|
style: OutlinedButton.styleFrom(
|
|
padding: const EdgeInsets.symmetric(horizontal: 28, vertical: 14),
|
|
side: const BorderSide(color: AppColors.cyan, width: 2),
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.circular(8),
|
|
),
|
|
foregroundColor: AppColors.cyan,
|
|
textStyle: AppTextStyles.button,
|
|
),
|
|
);
|
|
|
|
// Input Decoration Theme
|
|
static InputDecorationTheme _inputDecorationTheme =
|
|
InputDecorationTheme(
|
|
filled: true,
|
|
fillColor: AppColors.surface,
|
|
contentPadding:
|
|
const EdgeInsets.symmetric(horizontal: 20, vertical: 16),
|
|
border: OutlineInputBorder(
|
|
borderRadius: BorderRadius.circular(10),
|
|
borderSide: BorderSide(
|
|
color: AppColors.cyan.withOpacity(0.2),
|
|
width: 2,
|
|
),
|
|
),
|
|
enabledBorder: OutlineInputBorder(
|
|
borderRadius: BorderRadius.circular(10),
|
|
borderSide: BorderSide(
|
|
color: AppColors.cyan.withOpacity(0.2),
|
|
width: 2,
|
|
),
|
|
),
|
|
focusedBorder: OutlineInputBorder(
|
|
borderRadius: BorderRadius.circular(10),
|
|
borderSide: const BorderSide(color: AppColors.cyan, width: 2),
|
|
),
|
|
errorBorder: OutlineInputBorder(
|
|
borderRadius: BorderRadius.circular(10),
|
|
borderSide: const BorderSide(color: AppColors.error, width: 2),
|
|
),
|
|
focusedErrorBorder: OutlineInputBorder(
|
|
borderRadius: BorderRadius.circular(10),
|
|
borderSide: const BorderSide(color: AppColors.error, width: 2),
|
|
),
|
|
hintStyle: AppTextStyles.body.copyWith(color: AppColors.muted),
|
|
);
|
|
|
|
// Floating Action Button Theme
|
|
static FloatingActionButtonThemeData _floatingActionButtonTheme =
|
|
FloatingActionButtonThemeData(
|
|
elevation: 4,
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.circular(16),
|
|
),
|
|
backgroundColor: AppColors.cyan,
|
|
foregroundColor: AppColors.primary,
|
|
iconSize: 24,
|
|
);
|
|
|
|
// Bottom Navigation Bar Theme
|
|
static BottomNavigationBarThemeData _bottomNavigationBarTheme =
|
|
BottomNavigationBarThemeData(
|
|
elevation: 8,
|
|
backgroundColor: AppColors.surface,
|
|
selectedItemColor: AppColors.cyan,
|
|
unselectedItemColor: AppColors.muted,
|
|
selectedLabelStyle: AppTextStyles.caption,
|
|
unselectedLabelStyle: AppTextStyles.caption,
|
|
type: BottomNavigationBarType.fixed,
|
|
);
|
|
|
|
// Navigation Bar Theme (Material 3)
|
|
static NavigationBarThemeData _navigationBarTheme =
|
|
NavigationBarThemeData(
|
|
elevation: 0,
|
|
backgroundColor: AppColors.surface,
|
|
indicatorColor: AppColors.cyan.withOpacity(0.15),
|
|
labelTextStyle: MaterialStateProperty.all(AppTextStyles.caption),
|
|
height: 56,
|
|
);
|
|
|
|
// Slider Theme
|
|
static SliderThemeData _sliderTheme = SliderThemeData(
|
|
trackHeight: 3,
|
|
thumbShape: const RoundSliderThumbShape(
|
|
enabledThumbRadius: 6,
|
|
),
|
|
overlayShape: const RoundSliderOverlayShape(
|
|
overlayRadius: 16,
|
|
),
|
|
activeTrackColor: AppColors.cyan,
|
|
inactiveTrackColor: AppColors.surfaceVariant,
|
|
thumbColor: AppColors.cyan,
|
|
overlayColor: AppColors.cyan.withOpacity(0.2),
|
|
);
|
|
|
|
// Progress Indicator Theme
|
|
static ProgressIndicatorThemeData _progressIndicatorTheme =
|
|
ProgressIndicatorThemeData(
|
|
color: AppColors.cyan,
|
|
linearTrackColor: AppColors.surfaceVariant,
|
|
circularTrackColor: AppColors.surfaceVariant,
|
|
);
|
|
}
|