main.dart 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter/services.dart';
  3. import 'ui/main_menu.dart';
  4. import 'utils/colors.dart';
  5. import 'utils/settings_manager.dart';
  6. import 'utils/score_manager.dart';
  7. void main() async {
  8. WidgetsFlutterBinding.ensureInitialized();
  9. await SettingsManager.init();
  10. await ScoreManager.initialize();
  11. runApp(const ZenTapApp());
  12. }
  13. class ZenTapApp extends StatelessWidget {
  14. const ZenTapApp({super.key});
  15. @override
  16. Widget build(BuildContext context) {
  17. return MaterialApp(
  18. title: 'ZenTap',
  19. debugShowCheckedModeBanner: false,
  20. theme: ThemeData(
  21. // Use ZenTap color scheme
  22. colorScheme: ColorScheme.dark(
  23. primary: ZenColors.buttonBackground,
  24. secondary: ZenColors.defaultLink,
  25. surface: ZenColors.uiElements,
  26. onPrimary: ZenColors.buttonText,
  27. onSecondary: ZenColors.white,
  28. onSurface: ZenColors.primaryText,
  29. ),
  30. scaffoldBackgroundColor: ZenColors.appBackground,
  31. appBarTheme: const AppBarTheme(
  32. backgroundColor: ZenColors.appBackground,
  33. foregroundColor: ZenColors.primaryText,
  34. elevation: 0,
  35. systemOverlayStyle: SystemUiOverlayStyle.light,
  36. ),
  37. textTheme: const TextTheme(
  38. bodyLarge: TextStyle(color: ZenColors.primaryText),
  39. bodyMedium: TextStyle(color: ZenColors.primaryText),
  40. bodySmall: TextStyle(color: ZenColors.secondaryText),
  41. titleLarge: TextStyle(color: ZenColors.primaryText),
  42. titleMedium: TextStyle(color: ZenColors.primaryText),
  43. titleSmall: TextStyle(color: ZenColors.primaryText),
  44. ),
  45. elevatedButtonTheme: ElevatedButtonThemeData(
  46. style: ElevatedButton.styleFrom(
  47. backgroundColor: ZenColors.buttonBackground,
  48. foregroundColor: ZenColors.buttonText,
  49. elevation: 4,
  50. shape: RoundedRectangleBorder(
  51. borderRadius: BorderRadius.circular(12),
  52. ),
  53. ),
  54. ),
  55. dialogTheme: DialogThemeData(
  56. backgroundColor: ZenColors.uiElements,
  57. titleTextStyle: const TextStyle(
  58. color: ZenColors.primaryText,
  59. fontSize: 20,
  60. fontWeight: FontWeight.bold,
  61. ),
  62. contentTextStyle: TextStyle(
  63. color: ZenColors.secondaryText,
  64. fontSize: 16,
  65. ),
  66. ),
  67. useMaterial3: true,
  68. ),
  69. home: const MainMenu(),
  70. );
  71. }
  72. }