mirror of
https://github.com/R0m1k3/xtremflow.git
synced 2026-10-22 22:48:04 +02:00
feat(design): Warm Cinema redesign + fast-start players
Full visual overhaul from Cyber-Cinematic Glass to "Warm Cinema": warm charcoal (#0B0908), cream (#F3E9DF), ember (#D9541F). Fraunces (editorial serif) for display, Karla for body/UI. Design - app_colors: new palette, all existing token names preserved, plus posterScrim/heroScrim gradients and lift()/emberFocus() shadows - app_theme: new type scale, tighter radii, 20+ component themes - mobile_theme aligned on the same tokens - glass_container: opaque layered surfaces replace glassmorphism; adds GlassCard (hover + remote-focus states) and CinemaBackdrop - players and boot splash restyled (film-leader motif, no web fonts) Performance - remove every BackdropFilter (33 call sites): backdrop blur forced a full framebuffer read per frame per card, the main scroll jank source - bundle Fraunces/Karla as assets: google_fonts no longer fetches from fonts.gstatic.com at startup - drop the blocking hls.js CDN script from index.html; no Dart code ever used it, only the player iframes need it - self-host hls.js/mpegts.js and load them on demand, so ~213 KB of mpegts is never downloaded for HLS streams - bound image decode size on 10 sites: a 40-poster grid drops from ~240 MB to a few tens of MB of GPU memory Players (new shared engine: web/xf-player-core.js) - event-driven start instead of a 200 ms buffer poll plus a 1.5 s wait - initialLiveManifestSize 3 -> 1, liveSyncDurationCount 10 -> 2, startFragPrefetch on, testBandwidth off - MPEG-TS initial stash 512 KB -> 64 KB - adaptive escalation fast -> balanced -> safe on repeated stalls (60 s rolling window), applied live for HLS so there is no visible cut Pre-existing build breakage fixed along the way - undefined AppColors.shimmer, AppTheme.durationXs and spacing8/12/16/32 - broken relative imports in channel_card and quality_selector_widget - missing GlassCard widget and hasBorder/showShadow parameters Also resolves a leftover unmerged .claude/settings.local.json by keeping the remote version. Still broken (pre-existing, dead code, not reachable from main.dart): recommendations_provider.dart and continue_watching_widget.dart import a models/playlist.dart that no longer exists. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
cb5eca7547
commit
6f0f51384a
54 files changed
+2425
-1775
No files matched your search
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import '../../core/services/adaptive_bitrate_service.dart';
|
||||
import '../../../core/services/adaptive_bitrate_service.dart';
|
||||
import '../../../core/theme/app_colors.dart';
|
||||
|
||||
/// Widget for displaying and selecting video quality during playback
|
||||
class QualitySelectorWidget extends ConsumerStatefulWidget {
|
||||
@@ -35,7 +36,7 @@ class _QualitySelectorWidgetState extends ConsumerState<QualitySelectorWidget> {
|
||||
final bandwidthMbps = widget.qualitySelector.getEstimatedBandwidthMbps();
|
||||
|
||||
return Dialog(
|
||||
backgroundColor: Colors.black87,
|
||||
backgroundColor: AppColors.surfaceContainer,
|
||||
insetPadding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
@@ -45,7 +46,7 @@ class _QualitySelectorWidgetState extends ConsumerState<QualitySelectorWidget> {
|
||||
padding: const EdgeInsets.all(16),
|
||||
decoration: const BoxDecoration(
|
||||
border: Border(
|
||||
bottom: BorderSide(color: Colors.white24),
|
||||
bottom: BorderSide(color: AppColors.onSurface24),
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
@@ -54,13 +55,13 @@ class _QualitySelectorWidgetState extends ConsumerState<QualitySelectorWidget> {
|
||||
const Text(
|
||||
'Video Quality',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
color: AppColors.onSurface,
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
icon: const Icon(Icons.close, color: Colors.white),
|
||||
icon: const Icon(Icons.close, color: AppColors.onSurface),
|
||||
onPressed: widget.onClose,
|
||||
),
|
||||
],
|
||||
@@ -73,7 +74,7 @@ class _QualitySelectorWidgetState extends ConsumerState<QualitySelectorWidget> {
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(12),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white10,
|
||||
color: AppColors.onSurface06,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: Row(
|
||||
@@ -81,12 +82,12 @@ class _QualitySelectorWidgetState extends ConsumerState<QualitySelectorWidget> {
|
||||
children: [
|
||||
const Text(
|
||||
'Current Bandwidth:',
|
||||
style: TextStyle(color: Colors.white70, fontSize: 14),
|
||||
style: TextStyle(color: AppColors.onSurfaceVariant, fontSize: 14),
|
||||
),
|
||||
Text(
|
||||
'${bandwidthMbps.toStringAsFixed(1)} Mbps',
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
color: AppColors.onSurface,
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -108,22 +109,22 @@ class _QualitySelectorWidgetState extends ConsumerState<QualitySelectorWidget> {
|
||||
contentPadding:
|
||||
const EdgeInsets.symmetric(horizontal: 24, vertical: 8),
|
||||
leading: isSelected
|
||||
? const Icon(Icons.check_circle, color: Colors.blue)
|
||||
? const Icon(Icons.check_circle, color: AppColors.primary)
|
||||
: const Icon(
|
||||
Icons.radio_button_unchecked,
|
||||
color: Colors.white30,
|
||||
color: AppColors.onSurface24,
|
||||
),
|
||||
title: Text(
|
||||
quality.label,
|
||||
style: TextStyle(
|
||||
color: isSelected ? Colors.blue : Colors.white,
|
||||
color: isSelected ? AppColors.primary : AppColors.onSurface,
|
||||
fontWeight:
|
||||
isSelected ? FontWeight.bold : FontWeight.normal,
|
||||
),
|
||||
),
|
||||
subtitle: Text(
|
||||
'${quality.bitrateBps ~/ 1000000} Mbps',
|
||||
style: const TextStyle(color: Colors.white70, fontSize: 12),
|
||||
style: const TextStyle(color: AppColors.onSurfaceVariant, fontSize: 12),
|
||||
),
|
||||
onTap: () {
|
||||
widget.qualitySelector.setQuality(quality);
|
||||
@@ -141,7 +142,7 @@ class _QualitySelectorWidgetState extends ConsumerState<QualitySelectorWidget> {
|
||||
child: Container(
|
||||
decoration: const BoxDecoration(
|
||||
border: Border(
|
||||
top: BorderSide(color: Colors.white24),
|
||||
top: BorderSide(color: AppColors.onSurface24),
|
||||
),
|
||||
),
|
||||
child: ListTile(
|
||||
@@ -157,7 +158,7 @@ class _QualitySelectorWidgetState extends ConsumerState<QualitySelectorWidget> {
|
||||
),
|
||||
subtitle: const Text(
|
||||
'Adjusts based on network speed',
|
||||
style: TextStyle(color: Colors.white70, fontSize: 12),
|
||||
style: TextStyle(color: AppColors.onSurfaceVariant, fontSize: 12),
|
||||
),
|
||||
onTap: () {
|
||||
// Auto mode would be handled by the player
|
||||
@@ -194,18 +195,18 @@ class QualityIndicator extends ConsumerWidget {
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.black54,
|
||||
color: AppColors.baseLevel0,
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Icon(Icons.high_quality, color: Colors.white, size: 16),
|
||||
const Icon(Icons.high_quality, color: AppColors.onSurface, size: 16),
|
||||
const SizedBox(width: 4),
|
||||
Text(
|
||||
quality.resolution.split('x')[1], // Show just the height
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
color: AppColors.onSurface,
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -231,7 +232,7 @@ class BandwidthMonitor extends ConsumerWidget {
|
||||
return Container(
|
||||
padding: const EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.black54,
|
||||
color: AppColors.baseLevel0,
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
),
|
||||
child: Row(
|
||||
@@ -242,7 +243,7 @@ class BandwidthMonitor extends ConsumerWidget {
|
||||
Text(
|
||||
'${qualitySelector.getEstimatedBandwidthMbps().toStringAsFixed(1)} Mbps',
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
color: AppColors.onSurface,
|
||||
fontSize: 11,
|
||||
),
|
||||
),
|
||||
|
||||
Reference in new issue
Block a user