mirror of
https://github.com/R0m1k3/xtremobile.git
synced 2026-10-23 15:18:15 +02:00
UI: Clean up player controls (remove duplicate arrows, move LIVE badge)
This commit is contained in:
1 parent
e6281ff912
commit
3888a21990
12 files changed
+1121
-377
No files matched your search
@@ -7,22 +7,26 @@ class MobileSettings {
|
||||
final List<String> liveTvKeywords;
|
||||
final List<String> moviesKeywords;
|
||||
final List<String> seriesKeywords;
|
||||
final bool showClock;
|
||||
|
||||
const MobileSettings({
|
||||
this.liveTvKeywords = const [],
|
||||
this.moviesKeywords = const [],
|
||||
this.seriesKeywords = const [],
|
||||
this.showClock = false,
|
||||
});
|
||||
|
||||
MobileSettings copyWith({
|
||||
List<String>? liveTvKeywords,
|
||||
List<String>? moviesKeywords,
|
||||
List<String>? seriesKeywords,
|
||||
bool? showClock,
|
||||
}) {
|
||||
return MobileSettings(
|
||||
liveTvKeywords: liveTvKeywords ?? this.liveTvKeywords,
|
||||
moviesKeywords: moviesKeywords ?? this.moviesKeywords,
|
||||
seriesKeywords: seriesKeywords ?? this.seriesKeywords,
|
||||
showClock: showClock ?? this.showClock,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -68,11 +72,13 @@ class MobileSettingsNotifier extends StateNotifier<MobileSettings> {
|
||||
final liveTv = _box?.get('liveTvKeywords', defaultValue: <String>[]) as List?;
|
||||
final movies = _box?.get('moviesKeywords', defaultValue: <String>[]) as List?;
|
||||
final series = _box?.get('seriesKeywords', defaultValue: <String>[]) as List?;
|
||||
final showClock = _box?.get('showClock', defaultValue: false) as bool?;
|
||||
|
||||
state = MobileSettings(
|
||||
liveTvKeywords: liveTv?.cast<String>() ?? [],
|
||||
moviesKeywords: movies?.cast<String>() ?? [],
|
||||
seriesKeywords: series?.cast<String>() ?? [],
|
||||
showClock: showClock ?? false,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -90,6 +96,11 @@ class MobileSettingsNotifier extends StateNotifier<MobileSettings> {
|
||||
state = state.copyWith(seriesKeywords: keywords);
|
||||
_box?.put('seriesKeywords', keywords);
|
||||
}
|
||||
|
||||
void toggleShowClock(bool value) {
|
||||
state = state.copyWith(showClock: value);
|
||||
_box?.put('showClock', value);
|
||||
}
|
||||
}
|
||||
|
||||
final mobileSettingsProvider = StateNotifierProvider<MobileSettingsNotifier, MobileSettings>((ref) {
|
||||
|
||||
@@ -13,7 +13,7 @@ import 'package:path_provider/path_provider.dart';
|
||||
final mobileXtreamServiceProvider = FutureProvider.family<XtreamServiceMobile, PlaylistConfig>((ref, playlist) async {
|
||||
final dir = await getApplicationDocumentsDirectory();
|
||||
final service = XtreamServiceMobile(dir.path);
|
||||
service.setPlaylist(playlist);
|
||||
await service.setPlaylistAsync(playlist); // Async to resolve DNS before API calls
|
||||
return service;
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user