Add admin management tabs and TV/mobile fixes

This commit is contained in:
kihong.kim
2026-01-24 21:44:13 +09:00
parent 807df3d678
commit 29881aa442
10 changed files with 522 additions and 105 deletions

View File

@@ -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();
}
}