feat: add mobile Xtream service, data providers, and UI widgets for Live TV and Movies.

This commit is contained in:
Michael committed 2026-03-27 15:15:44 +01:00
1 parent 527582e21b
commit a1b1363bc8
9 files changed
+875 -774

No files matched your search

@@ -107,11 +107,20 @@ final mobileMoviesProvider =
return service.getMoviesByCategory(""); // Fetch all or default
});
/// Mobile-specific series pagination provider
final mobileSeriesProvider =
FutureProvider.family<List<model.Series>, PlaylistConfig>((ref, playlist) async {
/// Mobile-specific series categories provider
final mobileSeriesCategoriesProvider =
FutureProvider.family<List<model.Category>, PlaylistConfig>(
(ref, playlist) async {
final service = await ref.watch(mobileXtreamServiceProvider(playlist).future);
return service.getSeriesPaginated();
return service.getSeriesCategories();
});
/// Mobile-specific series pagination provider
final mobileSeriesProvider = FutureProvider.family<List<model.Series>,
(PlaylistConfig, String?)>((ref, params) async {
final (playlist, categoryId) = params;
final service = await ref.watch(mobileXtreamServiceProvider(playlist).future);
return service.getSeriesPaginated(categoryId: categoryId);
});
/// Series info with playlist context
@@ -0,0 +1,76 @@
import 'package:flutter/material.dart';
import 'package:xtremobile/core/theme/app_decorations.dart';
import 'package:xtremobile/mobile/widgets/tv_focusable.dart';
class MobileCategoryCard extends StatelessWidget {
final String title;
final VoidCallback onTap;
final IconData icon;
final Color iconColor;
const MobileCategoryCard({
super.key,
required this.title,
required this.onTap,
this.icon = Icons.folder_rounded,
this.iconColor = const Color(0xFF0A84FF),
});
@override
Widget build(BuildContext context) {
return TVFocusable(
onPressed: onTap,
borderRadius: BorderRadius.circular(16),
child: Stack(
children: [
// Base glossy background
Container(
decoration: AppDecorations.glossyCard(context, radius: 16),
),
// Glossy highlight overlay (shimmer)
Positioned(
top: 0,
left: 0,
right: 0,
height: 60,
child: IgnorePointer(
child: Container(
decoration: AppDecorations.glossShimmer(context, radius: 16),
),
),
),
// Content
Positioned.fill(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 12),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Icon(
icon,
color: iconColor,
size: 28,
),
const SizedBox(height: 8),
Text(
title,
style: TextStyle(
color: AppDecorations.textPrimary(context),
fontWeight: FontWeight.w600,
fontSize: 12,
letterSpacing: 0.1,
),
textAlign: TextAlign.center,
maxLines: 2,
overflow: TextOverflow.ellipsis,
),
],
),
),
),
],
),
);
}
}
+14 -13
View File
@@ -26,7 +26,6 @@ class MobilePosterCard extends StatelessWidget {
@override
Widget build(BuildContext context) {
final isDark = Theme.of(context).brightness == Brightness.dark;
return Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
@@ -34,18 +33,7 @@ class MobilePosterCard extends StatelessWidget {
// Shadow lives on this outer Container so ClipRRect doesn't swallow it
Expanded(
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
boxShadow: [
BoxShadow(
color: isDark
? const Color(0x99000000)
: const Color(0x28000000),
blurRadius: 12,
offset: const Offset(0, 6),
),
],
),
decoration: AppDecorations.glossyCard(context, radius: 12),
child: TVFocusable(
onPressed: onTap,
onLongPress: onLongPress,
@@ -144,6 +132,19 @@ class MobilePosterCard extends StatelessWidget {
),
),
),
// Glossy highlight overlay (top shimmer)
Positioned(
top: 0,
left: 0,
right: 0,
height: 80, // Taller for posters
child: IgnorePointer(
child: Container(
decoration: AppDecorations.glossShimmer(context, radius: 12),
),
),
),
],
),
),