mirror of
https://github.com/R0m1k3/xtremflow.git
synced 2026-10-23 06:58:05 +02:00
feat(iptv): introduce settings provider and tab for managing IPTV preferences
This commit is contained in:
1 parent
e5af0ec044
commit
7d13132fcd
3 files changed
+16
-1
No files matched your search
@@ -236,6 +236,16 @@ class IptvSettingsNotifier extends StateNotifier<IptvSettings> {
|
|||||||
|
|
||||||
IptvSettingsNotifier(this._ref) : super(const IptvSettings()) {
|
IptvSettingsNotifier(this._ref) : super(const IptvSettings()) {
|
||||||
_loadSettings();
|
_loadSettings();
|
||||||
|
_setupAuthListener();
|
||||||
|
}
|
||||||
|
|
||||||
|
void _setupAuthListener() {
|
||||||
|
_ref.listen<AuthState>(authProvider, (previous, next) {
|
||||||
|
if (previous?.isAuthenticated == false && next.isAuthenticated) {
|
||||||
|
// User just logged in, sync settings from API
|
||||||
|
_fetchFromApi();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Load settings from SharedPreferences and then API
|
/// Load settings from SharedPreferences and then API
|
||||||
|
|||||||
@@ -470,10 +470,15 @@ class _SettingsTabState extends ConsumerState<SettingsTab> with SingleTickerProv
|
|||||||
style: FilledButton.styleFrom(backgroundColor: Colors.orange),
|
style: FilledButton.styleFrom(backgroundColor: Colors.orange),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
// Clear PaintingCache
|
|
||||||
|
// Clear Flutter Image Cache
|
||||||
PaintingBinding.instance.imageCache.clear();
|
PaintingBinding.instance.imageCache.clear();
|
||||||
PaintingBinding.instance.imageCache.clearLiveImages();
|
PaintingBinding.instance.imageCache.clearLiveImages();
|
||||||
|
|
||||||
|
// Clear Browser Local Storage (SharedPreferences backend for Web)
|
||||||
|
html.window.localStorage.clear();
|
||||||
|
html.window.sessionStorage.clear();
|
||||||
|
|
||||||
// Reload application
|
// Reload application
|
||||||
html.window.location.reload();
|
html.window.location.reload();
|
||||||
},
|
},
|
||||||
|
|||||||
Binary file not shown.
Reference in new issue
Block a user