Add admin management tabs and TV/mobile fixes
This commit is contained in:
@@ -22,6 +22,7 @@ Future<void> main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
// Hide status bar for TV immersive experience
|
||||
SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersiveSticky);
|
||||
GoogleFonts.config.allowRuntimeFetching = false;
|
||||
|
||||
await initializeDateFormatting();
|
||||
|
||||
@@ -120,9 +121,8 @@ class MyApp extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
),
|
||||
initialRoute: '/',
|
||||
home: const AdaptiveHome(),
|
||||
routes: {
|
||||
'/': (context) => const TvDashboardScreen(),
|
||||
'/mobile': (context) => const MobileHomeScreen(),
|
||||
'/admin': (context) => const AdminScreen(),
|
||||
},
|
||||
@@ -130,3 +130,25 @@ class MyApp extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class AdaptiveHome extends StatelessWidget {
|
||||
const AdaptiveHome({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
const forceTv = String.fromEnvironment('FORCE_TV', defaultValue: 'false');
|
||||
if (forceTv.toLowerCase() == 'true') {
|
||||
return const TvDashboardScreen();
|
||||
}
|
||||
|
||||
final size = MediaQuery.of(context).size;
|
||||
final shortestSide = size.shortestSide;
|
||||
final isMobile = shortestSide < 600;
|
||||
|
||||
if (isMobile) {
|
||||
return const MobileHomeScreen();
|
||||
}
|
||||
|
||||
return const TvDashboardScreen();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user