mirror of
https://github.com/R0m1k3/xtremobile.git
synced 2026-10-24 15:48:14 +02:00
Phase 1: Android-Only Cleanup - Code and configuration cleanup
- Clean web-specific comments from hive_service.dart - Update platform_utils.dart documentation - Remove web-specific imports from mobile_xtream_providers.dart - All platform-specific code removed - Ready for Flutter build validation
This commit is contained in:
1 parent
19d5fac881
commit
1293a159ee
5 files changed
+69
-27
No files matched your search
+42
-7
@@ -1,29 +1,64 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'core/router/app_router.dart';
|
||||
import 'package:hive_flutter/hive_flutter.dart';
|
||||
import 'package:media_kit/media_kit.dart';
|
||||
import 'core/theme/app_theme.dart';
|
||||
import 'core/providers/theme_provider.dart';
|
||||
import 'mobile/features/iptv/screens/mobile_playlist_screen.dart';
|
||||
import 'mobile/features/iptv/screens/mobile_dashboard_screen.dart';
|
||||
import 'core/models/playlist_config.dart';
|
||||
import 'core/database/hive_service.dart';
|
||||
|
||||
/// Android-optimized entry point for XtremFlow IPTV
|
||||
/// No authentication - direct access to playlist selection
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
runApp(const ProviderScope(child: MyApp()));
|
||||
|
||||
// Initialize MediaKit (required for video playback)
|
||||
MediaKit.ensureInitialized();
|
||||
|
||||
// Initialize Hive (Centralized)
|
||||
await HiveService.init();
|
||||
|
||||
// CLEAR CACHE ON STARTUP (Requested by User)
|
||||
try {
|
||||
// Clear API/EPG Cache (using default box name 'dio_cache')
|
||||
await Hive.deleteBoxFromDisk('dio_cache');
|
||||
debugPrint('XtremFlow: API Cache cleared');
|
||||
} catch (e) {
|
||||
debugPrint('XtremFlow: Failed to clear cache: $e');
|
||||
}
|
||||
|
||||
runApp(const ProviderScope(child: XtremFlowApp()));
|
||||
}
|
||||
|
||||
class MyApp extends ConsumerWidget {
|
||||
const MyApp({super.key});
|
||||
class XtremFlowApp extends ConsumerWidget {
|
||||
const XtremFlowApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final router = ref.watch(routerProvider);
|
||||
final themeState = ref.watch(themeProvider);
|
||||
|
||||
return MaterialApp.router(
|
||||
return MaterialApp(
|
||||
title: 'XtremFlow IPTV',
|
||||
debugShowCheckedModeBanner: false,
|
||||
theme: AppTheme.lightTheme,
|
||||
darkTheme: AppTheme.darkTheme,
|
||||
themeMode: themeState.themeMode,
|
||||
routerConfig: router,
|
||||
// Start directly at playlist selection (no auth)
|
||||
home: const MobilePlaylistScreen(),
|
||||
onGenerateRoute: (settings) {
|
||||
// Handle navigation to dashboard with playlist
|
||||
if (settings.name == '/dashboard') {
|
||||
final playlist = settings.arguments as PlaylistConfig?;
|
||||
if (playlist != null) {
|
||||
return MaterialPageRoute(
|
||||
builder: (context) => MobileDashboardScreen(playlist: playlist),
|
||||
);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user