mirror of
https://github.com/R0m1k3/xtremflow.git
synced 2026-10-11 17:30:00 +02:00
feat: add initial Windows desktop platform support files and configuration.
This commit is contained in:
1 parent
57b7acbead
commit
8c3a143f46
38 files changed
+2084
-481
No files matched your search
@@ -44,8 +44,8 @@ class _MobileLiveTVTabState extends ConsumerState<MobileLiveTVTab> {
|
||||
body: channelsAsync.when(
|
||||
loading: () => const Center(child: CircularProgressIndicator()),
|
||||
error: (e, s) => Center(
|
||||
child:
|
||||
Text('Error: $e', style: const TextStyle(color: Colors.white))),
|
||||
child: Text('Error: $e', style: const TextStyle(color: Colors.white)),
|
||||
),
|
||||
data: (groupedChannels) {
|
||||
var categories = groupedChannels.keys.toList();
|
||||
if (settings.liveTvKeywords.isNotEmpty) {
|
||||
@@ -98,8 +98,10 @@ class _MobileLiveTVTabState extends ConsumerState<MobileLiveTVTab> {
|
||||
hintStyle:
|
||||
GoogleFonts.inter(color: Colors.white54),
|
||||
border: InputBorder.none,
|
||||
prefixIcon: const Icon(Icons.search,
|
||||
color: Colors.white54),
|
||||
prefixIcon: const Icon(
|
||||
Icons.search,
|
||||
color: Colors.white54,
|
||||
),
|
||||
isDense: true,
|
||||
),
|
||||
),
|
||||
@@ -133,7 +135,9 @@ class _MobileLiveTVTabState extends ConsumerState<MobileLiveTVTab> {
|
||||
child: AnimatedContainer(
|
||||
duration: const Duration(milliseconds: 200),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 16, vertical: 10),
|
||||
horizontal: 16,
|
||||
vertical: 10,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: isSelected
|
||||
? Colors.white
|
||||
@@ -177,7 +181,8 @@ class _MobileLiveTVTabState extends ConsumerState<MobileLiveTVTab> {
|
||||
const Spacer(),
|
||||
GestureDetector(
|
||||
onTap: () => setState(
|
||||
() => _showFavoritesOnly = !_showFavoritesOnly),
|
||||
() => _showFavoritesOnly = !_showFavoritesOnly,
|
||||
),
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
@@ -211,8 +216,11 @@ class _MobileLiveTVTabState extends ConsumerState<MobileLiveTVTab> {
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Icon(Icons.tv_off,
|
||||
color: Colors.white24, size: 48),
|
||||
const Icon(
|
||||
Icons.tv_off,
|
||||
color: Colors.white24,
|
||||
size: 48,
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
Text(
|
||||
'No channels found',
|
||||
@@ -344,7 +352,8 @@ class _MobileChannelTile extends ConsumerWidget {
|
||||
current.title,
|
||||
style: GoogleFonts.inter(
|
||||
color: const Color(
|
||||
0xFFFFD700), // Gold/Amber for visibility check
|
||||
0xFFFFD700,
|
||||
), // Gold/Amber for visibility check
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
@@ -352,11 +361,14 @@ class _MobileChannelTile extends ConsumerWidget {
|
||||
overflow: TextOverflow.ellipsis,
|
||||
);
|
||||
},
|
||||
loading: () => const Text('...',
|
||||
style:
|
||||
TextStyle(color: Colors.white38, fontSize: 12)),
|
||||
error: (err, stack) => const Text('Err',
|
||||
style: TextStyle(color: Colors.red, fontSize: 10)),
|
||||
loading: () => const Text(
|
||||
'...',
|
||||
style: TextStyle(color: Colors.white38, fontSize: 12),
|
||||
),
|
||||
error: (err, stack) => const Text(
|
||||
'Err',
|
||||
style: TextStyle(color: Colors.red, fontSize: 10),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -367,8 +379,11 @@ class _MobileChannelTile extends ConsumerWidget {
|
||||
color: Colors.white.withOpacity(0.1),
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: const Icon(Icons.play_arrow_rounded,
|
||||
color: Colors.white, size: 16),
|
||||
child: const Icon(
|
||||
Icons.play_arrow_rounded,
|
||||
color: Colors.white,
|
||||
size: 16,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -205,7 +205,9 @@ class _MobileMoviesTabState extends ConsumerState<MobileMoviesTab> {
|
||||
child: TextField(
|
||||
controller: _searchController,
|
||||
style: GoogleFonts.inter(
|
||||
fontSize: 14, color: Colors.white),
|
||||
fontSize: 14,
|
||||
color: Colors.white,
|
||||
),
|
||||
decoration: InputDecoration(
|
||||
hintText: 'Search Movies...',
|
||||
hintStyle: GoogleFonts.inter(color: Colors.white54),
|
||||
@@ -218,18 +220,24 @@ class _MobileMoviesTabState extends ConsumerState<MobileMoviesTab> {
|
||||
),
|
||||
if (_isSearching)
|
||||
const SizedBox(
|
||||
width: 12,
|
||||
height: 12,
|
||||
child: CircularProgressIndicator(
|
||||
strokeWidth: 2, color: Colors.white)),
|
||||
width: 12,
|
||||
height: 12,
|
||||
child: CircularProgressIndicator(
|
||||
strokeWidth: 2,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
if (_searchQuery.isNotEmpty)
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
_searchController.clear();
|
||||
_onSearchChanged('');
|
||||
},
|
||||
child: const Icon(Icons.close,
|
||||
size: 16, color: Colors.white),
|
||||
child: const Icon(
|
||||
Icons.close,
|
||||
size: 16,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -295,8 +303,11 @@ class _MobileMoviesTabState extends ConsumerState<MobileMoviesTab> {
|
||||
)
|
||||
: Container(
|
||||
color: Colors.white10,
|
||||
child: const Icon(Icons.movie,
|
||||
color: Colors.white24)),
|
||||
child: const Icon(
|
||||
Icons.movie,
|
||||
color: Colors.white24,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
// Gradient Overlay
|
||||
@@ -312,11 +323,12 @@ class _MobileMoviesTabState extends ConsumerState<MobileMoviesTab> {
|
||||
end: Alignment.bottomCenter,
|
||||
colors: [
|
||||
Colors.transparent,
|
||||
Colors.black.withOpacity(0.9)
|
||||
Colors.black.withOpacity(0.9),
|
||||
],
|
||||
),
|
||||
borderRadius: const BorderRadius.vertical(
|
||||
bottom: Radius.circular(16)),
|
||||
bottom: Radius.circular(16),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -333,18 +345,22 @@ class _MobileMoviesTabState extends ConsumerState<MobileMoviesTab> {
|
||||
Text(
|
||||
movie.name,
|
||||
style: GoogleFonts.inter(
|
||||
color: Colors.white,
|
||||
fontSize: 13,
|
||||
fontWeight: FontWeight.w600),
|
||||
color: Colors.white,
|
||||
fontSize: 13,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
if (isWatched)
|
||||
Text('WATCHED',
|
||||
style: GoogleFonts.inter(
|
||||
color: AppColors.primary,
|
||||
fontSize: 10,
|
||||
fontWeight: FontWeight.bold)),
|
||||
Text(
|
||||
'WATCHED',
|
||||
style: GoogleFonts.inter(
|
||||
color: AppColors.primary,
|
||||
fontSize: 10,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -358,19 +374,25 @@ class _MobileMoviesTabState extends ConsumerState<MobileMoviesTab> {
|
||||
borderRadius: 4,
|
||||
opacity: 0.6,
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 6, vertical: 2),
|
||||
horizontal: 6,
|
||||
vertical: 2,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Icon(Icons.star,
|
||||
size: 10, color: Colors.amber),
|
||||
const Icon(
|
||||
Icons.star,
|
||||
size: 10,
|
||||
color: Colors.amber,
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
Text(
|
||||
_formatRating(movie.rating)!,
|
||||
style: GoogleFonts.inter(
|
||||
fontSize: 10,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.white),
|
||||
fontSize: 10,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -390,7 +412,8 @@ class _MobileMoviesTabState extends ConsumerState<MobileMoviesTab> {
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(24),
|
||||
child: Center(
|
||||
child: CircularProgressIndicator(color: Colors.white)),
|
||||
child: CircularProgressIndicator(color: Colors.white),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -29,7 +29,7 @@ class _MobileSeriesTabState extends ConsumerState<MobileSeriesTab> {
|
||||
bool _isSearching = false;
|
||||
bool _hasMore = true;
|
||||
int _currentOffset = 0;
|
||||
static const int _pageSize = 50;
|
||||
static const int _pageSize = 50;
|
||||
Timer? _searchDebounce;
|
||||
|
||||
@override
|
||||
@@ -48,9 +48,10 @@ class _MobileSeriesTabState extends ConsumerState<MobileSeriesTab> {
|
||||
}
|
||||
|
||||
void _onScroll() {
|
||||
if (!_isLoading && _hasMore &&
|
||||
if (!_isLoading &&
|
||||
_hasMore &&
|
||||
_scrollController.position.pixels >=
|
||||
_scrollController.position.maxScrollExtent * 0.8) {
|
||||
_scrollController.position.maxScrollExtent * 0.8) {
|
||||
_loadMoreSeries();
|
||||
}
|
||||
}
|
||||
@@ -64,7 +65,7 @@ class _MobileSeriesTabState extends ConsumerState<MobileSeriesTab> {
|
||||
_isSearching = false;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
if (query.length >= 2) {
|
||||
_searchDebounce = Timer(const Duration(milliseconds: 500), () {
|
||||
_performSearch(query);
|
||||
@@ -75,11 +76,11 @@ class _MobileSeriesTabState extends ConsumerState<MobileSeriesTab> {
|
||||
Future<void> _performSearch(String query) async {
|
||||
if (query.isEmpty) return;
|
||||
setState(() => _isSearching = true);
|
||||
|
||||
|
||||
try {
|
||||
final service = ref.read(xtreamServiceProvider(widget.playlist));
|
||||
final results = await service.searchSeries(query);
|
||||
|
||||
|
||||
if (mounted && _searchQuery == query) {
|
||||
setState(() {
|
||||
_searchResults = results;
|
||||
@@ -150,23 +151,30 @@ class _MobileSeriesTabState extends ConsumerState<MobileSeriesTab> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final settings = ref.watch(iptvSettingsProvider);
|
||||
|
||||
|
||||
List<Series> displaySeries;
|
||||
if (_searchQuery.isNotEmpty && _searchResults != null) {
|
||||
displaySeries = _searchResults!;
|
||||
} else {
|
||||
displaySeries = settings.seriesKeywords.isEmpty
|
||||
? _series
|
||||
: _series.where((s) => settings.matchesSeriesFilter(s.categoryName)).toList();
|
||||
: _series
|
||||
.where((s) => settings.matchesSeriesFilter(s.categoryName))
|
||||
.toList();
|
||||
}
|
||||
|
||||
final heroItems = displaySeries.take(3).map((s) => HeroItem(
|
||||
id: s.seriesId.toString(),
|
||||
title: s.name,
|
||||
imageUrl: _getProxiedImageUrl(s.cover),
|
||||
subtitle: s.rating != null ? '${_formatRating(s.rating)} ★' : null,
|
||||
onMoreInfo: () => _openSeries(s),
|
||||
)).toList();
|
||||
final heroItems = displaySeries
|
||||
.take(3)
|
||||
.map(
|
||||
(s) => HeroItem(
|
||||
id: s.seriesId.toString(),
|
||||
title: s.name,
|
||||
imageUrl: _getProxiedImageUrl(s.cover),
|
||||
subtitle: s.rating != null ? '${_formatRating(s.rating)} ★' : null,
|
||||
onMoreInfo: () => _openSeries(s),
|
||||
),
|
||||
)
|
||||
.toList();
|
||||
|
||||
return SafeArea(
|
||||
bottom: false,
|
||||
@@ -180,7 +188,8 @@ class _MobileSeriesTabState extends ConsumerState<MobileSeriesTab> {
|
||||
child: GlassContainer(
|
||||
borderRadius: 100,
|
||||
opacity: 0.1,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
||||
child: Row(
|
||||
children: [
|
||||
const Icon(Icons.search, size: 20, color: Colors.white54),
|
||||
@@ -188,7 +197,8 @@ class _MobileSeriesTabState extends ConsumerState<MobileSeriesTab> {
|
||||
Expanded(
|
||||
child: TextField(
|
||||
controller: _searchController,
|
||||
style: GoogleFonts.inter(fontSize: 14, color: Colors.white),
|
||||
style: GoogleFonts.inter(
|
||||
fontSize: 14, color: Colors.white),
|
||||
decoration: InputDecoration(
|
||||
hintText: 'Search Series...',
|
||||
hintStyle: GoogleFonts.inter(color: Colors.white54),
|
||||
@@ -200,14 +210,19 @@ class _MobileSeriesTabState extends ConsumerState<MobileSeriesTab> {
|
||||
),
|
||||
),
|
||||
if (_isSearching)
|
||||
const SizedBox(width: 12, height: 12, child: CircularProgressIndicator(strokeWidth: 2, color: Colors.white)),
|
||||
const SizedBox(
|
||||
width: 12,
|
||||
height: 12,
|
||||
child: CircularProgressIndicator(
|
||||
strokeWidth: 2, color: Colors.white)),
|
||||
if (_searchQuery.isNotEmpty)
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
_searchController.clear();
|
||||
_onSearchChanged('');
|
||||
_searchController.clear();
|
||||
_onSearchChanged('');
|
||||
},
|
||||
child: const Icon(Icons.close, size: 16, color: Colors.white),
|
||||
child: const Icon(Icons.close,
|
||||
size: 16, color: Colors.white),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -221,22 +236,23 @@ class _MobileSeriesTabState extends ConsumerState<MobileSeriesTab> {
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(bottom: 24),
|
||||
child: SizedBox(
|
||||
height: 250,
|
||||
child: HeroCarousel(
|
||||
items: heroItems,
|
||||
onTap: (item) {
|
||||
try {
|
||||
final series = _series.firstWhere((s) => s.seriesId.toString() == item.id);
|
||||
_openSeries(series);
|
||||
} catch (e) {
|
||||
// Fallback
|
||||
}
|
||||
},
|
||||
),
|
||||
height: 250,
|
||||
child: HeroCarousel(
|
||||
items: heroItems,
|
||||
onTap: (item) {
|
||||
try {
|
||||
final series = _series.firstWhere(
|
||||
(s) => s.seriesId.toString() == item.id);
|
||||
_openSeries(series);
|
||||
} catch (e) {
|
||||
// Fallback
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
|
||||
// Grid
|
||||
SliverPadding(
|
||||
padding: const EdgeInsets.fromLTRB(16, 0, 16, 80),
|
||||
@@ -251,7 +267,7 @@ class _MobileSeriesTabState extends ConsumerState<MobileSeriesTab> {
|
||||
(context, index) {
|
||||
if (index >= displaySeries.length) return null;
|
||||
final series = displaySeries[index];
|
||||
|
||||
|
||||
return GestureDetector(
|
||||
onTap: () => _openSeries(series),
|
||||
child: Stack(
|
||||
@@ -260,37 +276,53 @@ class _MobileSeriesTabState extends ConsumerState<MobileSeriesTab> {
|
||||
// Poster
|
||||
ClipRRect(
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
child: series.cover != null && series.cover!.isNotEmpty
|
||||
? Image.network(
|
||||
_getProxiedImageUrl(series.cover),
|
||||
fit: BoxFit.cover,
|
||||
errorBuilder: (_, __, ___) => Container(color: Colors.white10),
|
||||
)
|
||||
: Container(color: Colors.white10, child: const Icon(Icons.tv, color: Colors.white24)),
|
||||
child:
|
||||
series.cover != null && series.cover!.isNotEmpty
|
||||
? Image.network(
|
||||
_getProxiedImageUrl(series.cover),
|
||||
fit: BoxFit.cover,
|
||||
errorBuilder: (_, __, ___) =>
|
||||
Container(color: Colors.white10),
|
||||
)
|
||||
: Container(
|
||||
color: Colors.white10,
|
||||
child: const Icon(Icons.tv,
|
||||
color: Colors.white24)),
|
||||
),
|
||||
|
||||
|
||||
// Gradient Overlay
|
||||
Positioned(
|
||||
bottom: 0, left: 0, right: 0,
|
||||
bottom: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
height: 80,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
colors: [Colors.transparent, Colors.black.withOpacity(0.9)],
|
||||
colors: [
|
||||
Colors.transparent,
|
||||
Colors.black.withOpacity(0.9)
|
||||
],
|
||||
),
|
||||
borderRadius: const BorderRadius.vertical(bottom: Radius.circular(16)),
|
||||
borderRadius: const BorderRadius.vertical(
|
||||
bottom: Radius.circular(16)),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
// Title
|
||||
Positioned(
|
||||
bottom: 12, left: 12, right: 12,
|
||||
bottom: 12,
|
||||
left: 12,
|
||||
right: 12,
|
||||
child: Text(
|
||||
series.name,
|
||||
style: GoogleFonts.inter(color: Colors.white, fontSize: 13, fontWeight: FontWeight.w600),
|
||||
style: GoogleFonts.inter(
|
||||
color: Colors.white,
|
||||
fontSize: 13,
|
||||
fontWeight: FontWeight.w600),
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
@@ -299,19 +331,25 @@ class _MobileSeriesTabState extends ConsumerState<MobileSeriesTab> {
|
||||
// Rating
|
||||
if (series.rating != null && series.rating!.isNotEmpty)
|
||||
Positioned(
|
||||
top: 8, right: 8,
|
||||
top: 8,
|
||||
right: 8,
|
||||
child: GlassContainer(
|
||||
borderRadius: 4,
|
||||
opacity: 0.6,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 2),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 6, vertical: 2),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Icon(Icons.star, size: 10, color: Colors.amber),
|
||||
const Icon(Icons.star,
|
||||
size: 10, color: Colors.amber),
|
||||
const SizedBox(width: 4),
|
||||
Text(
|
||||
_formatRating(series.rating)!,
|
||||
style: GoogleFonts.inter(fontSize: 10, fontWeight: FontWeight.bold, color: Colors.white),
|
||||
style: GoogleFonts.inter(
|
||||
fontSize: 10,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.white),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -325,12 +363,13 @@ class _MobileSeriesTabState extends ConsumerState<MobileSeriesTab> {
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
|
||||
if (_isLoading)
|
||||
const SliverToBoxAdapter(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(24),
|
||||
child: Center(child: CircularProgressIndicator(color: Colors.white)),
|
||||
child: Center(
|
||||
child: CircularProgressIndicator(color: Colors.white)),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -37,13 +37,16 @@ class _MobileSettingsTabState extends ConsumerState<MobileSettingsTab> {
|
||||
}
|
||||
|
||||
void _syncControllers(IptvSettings settings) {
|
||||
if (!_initialized || _liveTvController.text != settings.liveTvCategoryFilter) {
|
||||
if (!_initialized ||
|
||||
_liveTvController.text != settings.liveTvCategoryFilter) {
|
||||
_liveTvController.text = settings.liveTvCategoryFilter;
|
||||
}
|
||||
if (!_initialized || _moviesController.text != settings.moviesCategoryFilter) {
|
||||
if (!_initialized ||
|
||||
_moviesController.text != settings.moviesCategoryFilter) {
|
||||
_moviesController.text = settings.moviesCategoryFilter;
|
||||
}
|
||||
if (!_initialized || _seriesController.text != settings.seriesCategoryFilter) {
|
||||
if (!_initialized ||
|
||||
_seriesController.text != settings.seriesCategoryFilter) {
|
||||
_seriesController.text = settings.seriesCategoryFilter;
|
||||
}
|
||||
_initialized = true;
|
||||
@@ -56,7 +59,7 @@ class _MobileSettingsTabState extends ConsumerState<MobileSettingsTab> {
|
||||
final themeState = ref.watch(themeProvider);
|
||||
final themeNotifier = ref.read(themeProvider.notifier);
|
||||
final isDark = Theme.of(context).brightness == Brightness.dark;
|
||||
|
||||
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
if (!_initialized) _syncControllers(settings);
|
||||
});
|
||||
@@ -66,7 +69,7 @@ class _MobileSettingsTabState extends ConsumerState<MobileSettingsTab> {
|
||||
padding: const EdgeInsets.all(16),
|
||||
children: [
|
||||
// Header
|
||||
Padding(
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 24),
|
||||
child: Text(
|
||||
'Settings',
|
||||
@@ -87,7 +90,8 @@ class _MobileSettingsTabState extends ConsumerState<MobileSettingsTab> {
|
||||
backgroundColor: AppColors.primary.withOpacity(0.2),
|
||||
child: Text(
|
||||
currentUser?.username.substring(0, 1).toUpperCase() ?? 'U',
|
||||
style: const TextStyle(fontWeight: FontWeight.bold, color: AppColors.primary),
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.bold, color: AppColors.primary),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
@@ -106,12 +110,17 @@ class _MobileSettingsTabState extends ConsumerState<MobileSettingsTab> {
|
||||
if (currentUser?.isAdmin ?? false)
|
||||
Container(
|
||||
margin: const EdgeInsets.only(top: 4),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 2),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 8, vertical: 2),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.primary.withOpacity(0.2),
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
),
|
||||
child: const Text('ADMIN', style: TextStyle(fontSize: 10, color: AppColors.primary, fontWeight: FontWeight.bold)),
|
||||
child: const Text('ADMIN',
|
||||
style: TextStyle(
|
||||
fontSize: 10,
|
||||
color: AppColors.primary,
|
||||
fontWeight: FontWeight.bold)),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -131,19 +140,24 @@ class _MobileSettingsTabState extends ConsumerState<MobileSettingsTab> {
|
||||
child: Column(
|
||||
children: [
|
||||
SwitchListTile(
|
||||
title: const Text('Dark Mode', style: TextStyle(color: AppColors.textPrimary)),
|
||||
secondary: Icon(isDark ? Icons.dark_mode : Icons.light_mode, color: AppColors.primary),
|
||||
title: const Text('Dark Mode',
|
||||
style: TextStyle(color: AppColors.textPrimary)),
|
||||
secondary: Icon(isDark ? Icons.dark_mode : Icons.light_mode,
|
||||
color: AppColors.primary),
|
||||
value: isDark,
|
||||
onChanged: (_) => themeNotifier.toggleTheme(),
|
||||
activeColor: AppColors.primary,
|
||||
activeThumbColor: AppColors.primary,
|
||||
),
|
||||
const Divider(height: 1),
|
||||
SwitchListTile(
|
||||
title: const Text('Show Clock', style: TextStyle(color: AppColors.textPrimary)),
|
||||
secondary: const Icon(Icons.access_time, color: AppColors.primary),
|
||||
title: const Text('Show Clock',
|
||||
style: TextStyle(color: AppColors.textPrimary)),
|
||||
secondary:
|
||||
const Icon(Icons.access_time, color: AppColors.primary),
|
||||
value: settings.showClock,
|
||||
onChanged: (val) => ref.read(iptvSettingsProvider.notifier).setShowClock(val),
|
||||
activeColor: AppColors.primary,
|
||||
onChanged: (val) =>
|
||||
ref.read(iptvSettingsProvider.notifier).setShowClock(val),
|
||||
activeThumbColor: AppColors.primary,
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -167,7 +181,10 @@ class _MobileSettingsTabState extends ConsumerState<MobileSettingsTab> {
|
||||
items: StreamQuality.values,
|
||||
labelBuilder: (v) => v.name.toUpperCase(),
|
||||
onChanged: (v) {
|
||||
if (v != null) ref.read(iptvSettingsProvider.notifier).setStreamQuality(v);
|
||||
if (v != null)
|
||||
ref
|
||||
.read(iptvSettingsProvider.notifier)
|
||||
.setStreamQuality(v);
|
||||
},
|
||||
),
|
||||
const Divider(height: 1),
|
||||
@@ -178,19 +195,24 @@ class _MobileSettingsTabState extends ConsumerState<MobileSettingsTab> {
|
||||
items: BufferSize.values,
|
||||
labelBuilder: (v) => v.name.toUpperCase(),
|
||||
onChanged: (v) {
|
||||
if (v != null) ref.read(iptvSettingsProvider.notifier).setBufferSize(v);
|
||||
if (v != null)
|
||||
ref.read(iptvSettingsProvider.notifier).setBufferSize(v);
|
||||
},
|
||||
),
|
||||
const Divider(height: 1),
|
||||
_DropdownSetting<ConnectionTimeout>(
|
||||
label: 'Timeout',
|
||||
icon: Icons.timer,
|
||||
value: settings.connectionTimeout,
|
||||
items: ConnectionTimeout.values,
|
||||
labelBuilder: (v) => '${v.name.toUpperCase()} (${ref.read(iptvSettingsProvider).timeoutSeconds}s)',
|
||||
onChanged: (v) {
|
||||
if (v != null) ref.read(iptvSettingsProvider.notifier).setConnectionTimeout(v);
|
||||
},
|
||||
label: 'Timeout',
|
||||
icon: Icons.timer,
|
||||
value: settings.connectionTimeout,
|
||||
items: ConnectionTimeout.values,
|
||||
labelBuilder: (v) =>
|
||||
'${v.name.toUpperCase()} (${ref.read(iptvSettingsProvider).timeoutSeconds}s)',
|
||||
onChanged: (v) {
|
||||
if (v != null)
|
||||
ref
|
||||
.read(iptvSettingsProvider.notifier)
|
||||
.setConnectionTimeout(v);
|
||||
},
|
||||
),
|
||||
const Divider(height: 1),
|
||||
_DropdownSetting<TranscodingMode>(
|
||||
@@ -200,22 +222,32 @@ class _MobileSettingsTabState extends ConsumerState<MobileSettingsTab> {
|
||||
items: TranscodingMode.values,
|
||||
labelBuilder: (v) {
|
||||
switch (v) {
|
||||
case TranscodingMode.auto: return 'AUTO';
|
||||
case TranscodingMode.forced: return 'TRANSCODE';
|
||||
case TranscodingMode.disabled: return 'DIRECT';
|
||||
case TranscodingMode.auto:
|
||||
return 'AUTO';
|
||||
case TranscodingMode.forced:
|
||||
return 'TRANSCODE';
|
||||
case TranscodingMode.disabled:
|
||||
return 'DIRECT';
|
||||
}
|
||||
},
|
||||
onChanged: (v) {
|
||||
if (v != null) ref.read(iptvSettingsProvider.notifier).setTranscodingMode(v);
|
||||
if (v != null)
|
||||
ref
|
||||
.read(iptvSettingsProvider.notifier)
|
||||
.setTranscodingMode(v);
|
||||
},
|
||||
),
|
||||
const Divider(height: 1),
|
||||
SwitchListTile(
|
||||
title: const Text('Auto Reconnect', style: TextStyle(color: AppColors.textPrimary)),
|
||||
secondary: const Icon(Icons.refresh, color: AppColors.primary),
|
||||
SwitchListTile(
|
||||
title: const Text('Auto Reconnect',
|
||||
style: TextStyle(color: AppColors.textPrimary)),
|
||||
secondary:
|
||||
const Icon(Icons.refresh, color: AppColors.primary),
|
||||
value: settings.autoReconnect,
|
||||
onChanged: (val) => ref.read(iptvSettingsProvider.notifier).setAutoReconnect(val),
|
||||
activeColor: AppColors.primary,
|
||||
onChanged: (val) => ref
|
||||
.read(iptvSettingsProvider.notifier)
|
||||
.setAutoReconnect(val),
|
||||
activeThumbColor: AppColors.primary,
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -236,21 +268,27 @@ class _MobileSettingsTabState extends ConsumerState<MobileSettingsTab> {
|
||||
label: 'Live TV Keywords',
|
||||
icon: Icons.live_tv,
|
||||
controller: _liveTvController,
|
||||
onChanged: (val) => ref.read(iptvSettingsProvider.notifier).setLiveTvFilter(val),
|
||||
onChanged: (val) => ref
|
||||
.read(iptvSettingsProvider.notifier)
|
||||
.setLiveTvFilter(val),
|
||||
),
|
||||
const Divider(height: 24),
|
||||
_FilterInput(
|
||||
label: 'Movies Keywords',
|
||||
icon: Icons.movie,
|
||||
controller: _moviesController,
|
||||
onChanged: (val) => ref.read(iptvSettingsProvider.notifier).setMoviesFilter(val),
|
||||
onChanged: (val) => ref
|
||||
.read(iptvSettingsProvider.notifier)
|
||||
.setMoviesFilter(val),
|
||||
),
|
||||
const Divider(height: 24),
|
||||
_FilterInput(
|
||||
label: 'Series Keywords',
|
||||
icon: Icons.tv,
|
||||
controller: _seriesController,
|
||||
onChanged: (val) => ref.read(iptvSettingsProvider.notifier).setSeriesFilter(val),
|
||||
onChanged: (val) => ref
|
||||
.read(iptvSettingsProvider.notifier)
|
||||
.setSeriesFilter(val),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -271,19 +309,19 @@ class _MobileSettingsTabState extends ConsumerState<MobileSettingsTab> {
|
||||
onTap: () => context.go('/playlists'),
|
||||
),
|
||||
const SizedBox(height: 32),
|
||||
|
||||
|
||||
FilledButton.icon(
|
||||
onPressed: () {
|
||||
ref.read(authProvider.notifier).logout();
|
||||
context.go('/login');
|
||||
},
|
||||
style: FilledButton.styleFrom(
|
||||
backgroundColor: AppColors.error.withOpacity(0.1),
|
||||
foregroundColor: AppColors.error,
|
||||
minimumSize: const Size(double.infinity, 50),
|
||||
),
|
||||
icon: const Icon(Icons.logout),
|
||||
label: const Text('Logout'),
|
||||
onPressed: () {
|
||||
ref.read(authProvider.notifier).logout();
|
||||
context.go('/login');
|
||||
},
|
||||
style: FilledButton.styleFrom(
|
||||
backgroundColor: AppColors.error.withOpacity(0.1),
|
||||
foregroundColor: AppColors.error,
|
||||
minimumSize: const Size(double.infinity, 50),
|
||||
),
|
||||
icon: const Icon(Icons.logout),
|
||||
label: const Text('Logout'),
|
||||
),
|
||||
const SizedBox(height: 100),
|
||||
],
|
||||
@@ -335,10 +373,13 @@ class _FilterInput extends StatelessWidget {
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(label, style: const TextStyle(fontSize: 12, color: AppColors.textSecondary)),
|
||||
Text(label,
|
||||
style: const TextStyle(
|
||||
fontSize: 12, color: AppColors.textSecondary)),
|
||||
TextField(
|
||||
controller: controller,
|
||||
style: const TextStyle(fontSize: 14, color: AppColors.textPrimary),
|
||||
style:
|
||||
const TextStyle(fontSize: 14, color: AppColors.textPrimary),
|
||||
decoration: const InputDecoration(
|
||||
isDense: true,
|
||||
contentPadding: EdgeInsets.symmetric(vertical: 4),
|
||||
@@ -435,7 +476,8 @@ class _DropdownSetting<T> extends StatelessWidget {
|
||||
value: value,
|
||||
underline: const SizedBox(),
|
||||
dropdownColor: AppColors.surfaceVariant,
|
||||
icon: const Icon(Icons.arrow_drop_down, color: AppColors.textSecondary),
|
||||
icon: const Icon(Icons.arrow_drop_down,
|
||||
color: AppColors.textSecondary),
|
||||
style: const TextStyle(color: AppColors.textPrimary),
|
||||
items: items.map((item) {
|
||||
return DropdownMenuItem<T>(
|
||||
|
||||
Reference in new issue
Block a user