133 lines
4.5 KiB
Dart
133 lines
4.5 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter/services.dart';
|
|
import 'package:google_fonts/google_fonts.dart';
|
|
import 'package:intl/date_symbol_data_local.dart';
|
|
import 'package:provider/provider.dart';
|
|
|
|
import 'config/api_config.dart';
|
|
import 'screens/admin/admin_screen.dart';
|
|
import 'screens/mobile/mobile_home_screen.dart';
|
|
import 'screens/tv/tv_dashboard_screen.dart';
|
|
import 'services/announcement_service.dart';
|
|
import 'services/api_client.dart';
|
|
import 'services/bible_service.dart';
|
|
import 'services/bible_verse_service.dart';
|
|
import 'services/family_service.dart';
|
|
import 'services/photo_service.dart';
|
|
import 'services/schedule_service.dart';
|
|
import 'services/todo_service.dart';
|
|
import 'services/weather_service.dart';
|
|
|
|
Future<void> main() async {
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
// Hide status bar for TV immersive experience
|
|
SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersiveSticky);
|
|
|
|
await initializeDateFormatting();
|
|
|
|
runApp(const MyApp());
|
|
}
|
|
|
|
class MyApp extends StatelessWidget {
|
|
const MyApp({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
// Shared ApiClient instance
|
|
final apiClient = ApiClient();
|
|
|
|
return MultiProvider(
|
|
providers: [
|
|
Provider<ApiClient>.value(value: apiClient),
|
|
Provider<WeatherService>(create: (_) => WeatherService(apiClient)),
|
|
Provider<BibleService>(create: (_) => BibleService(apiClient)),
|
|
Provider<BibleVerseService>(
|
|
create: (_) => BibleVerseService(apiClient),
|
|
),
|
|
Provider<TodoService>(create: (_) => TodoService(apiClient)),
|
|
Provider<ScheduleService>(create: (_) => ScheduleService(apiClient)),
|
|
Provider<AnnouncementService>(
|
|
create: (_) => AnnouncementService(apiClient),
|
|
),
|
|
Provider<PhotoService>(create: (_) => PhotoService(apiClient)),
|
|
Provider<FamilyService>(create: (_) => FamilyService(apiClient)),
|
|
],
|
|
child: MaterialApp(
|
|
title: 'Bini Google TV Dashboard',
|
|
debugShowCheckedModeBanner: false,
|
|
theme: ThemeData(
|
|
useMaterial3: true,
|
|
brightness: Brightness.dark,
|
|
scaffoldBackgroundColor: const Color(
|
|
0xFF0F172A,
|
|
), // Deep Midnight Navy
|
|
colorScheme: const ColorScheme.dark(
|
|
primary: Color(0xFFFFD700), // Cinema Gold
|
|
onPrimary: Colors.black,
|
|
secondary: Color(0xFF4FC3F7), // Sky Blue
|
|
onSecondary: Colors.black,
|
|
surface: Color(0xFF1E293B), // Slate 800
|
|
onSurface: Colors.white,
|
|
background: Color(0xFF0F172A),
|
|
onBackground: Colors.white,
|
|
error: Color(0xFFFF6E40), // Deep Orange
|
|
),
|
|
cardTheme: CardThemeData(
|
|
color: const Color(0xFF1E293B),
|
|
elevation: 4,
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.circular(16),
|
|
),
|
|
),
|
|
textTheme: TextTheme(
|
|
displayLarge: GoogleFonts.outfit(
|
|
fontSize: 64,
|
|
fontWeight: FontWeight.bold,
|
|
color: Colors.white,
|
|
), // Header time
|
|
displayMedium: GoogleFonts.outfit(
|
|
fontSize: 40,
|
|
fontWeight: FontWeight.w600,
|
|
color: const Color(0xFFF1F5F9),
|
|
), // Section titles
|
|
bodyLarge: GoogleFonts.mulish(
|
|
fontSize: 24,
|
|
color: const Color(0xFFE2E8F0),
|
|
), // Main content
|
|
bodyMedium: GoogleFonts.mulish(
|
|
fontSize: 18,
|
|
color: const Color(0xFFCBD5E1),
|
|
), // Secondary content
|
|
displaySmall: GoogleFonts.outfit(
|
|
fontSize: 32,
|
|
fontWeight: FontWeight.bold,
|
|
color: Colors.white,
|
|
), // Clock usage
|
|
headlineSmall: GoogleFonts.outfit(
|
|
fontSize: 24,
|
|
fontWeight: FontWeight.bold,
|
|
color: Colors.white,
|
|
),
|
|
titleLarge: GoogleFonts.outfit(
|
|
fontSize: 22,
|
|
fontWeight: FontWeight.w600,
|
|
color: Colors.white,
|
|
),
|
|
titleMedium: GoogleFonts.outfit(
|
|
fontSize: 16,
|
|
fontWeight: FontWeight.w500,
|
|
color: const Color(0xFFF1F5F9),
|
|
),
|
|
),
|
|
),
|
|
initialRoute: '/',
|
|
routes: {
|
|
'/': (context) => const TvDashboardScreen(),
|
|
'/mobile': (context) => const MobileHomeScreen(),
|
|
'/admin': (context) => const AdminScreen(),
|
|
},
|
|
),
|
|
);
|
|
}
|
|
}
|