summaryrefslogtreecommitdiff
path: root/lib/main.dart
blob: 39a7f0537d5d4ead24962ed51376809a2c5118b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:mini_golf_scores/main_menu.dart';

void main() {
  LicenseRegistry.addLicense(() async* {
    final license = await rootBundle.loadString('LICENSE');
    yield LicenseEntryWithLineBreaks(['mini_golf_scores'], license);
  });
  runApp(const MiniGolfScoreApp());
}

class MiniGolfScoreApp extends StatelessWidget {
  const MiniGolfScoreApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData(
        brightness: Brightness.light,
        primarySwatch: Colors.blue, // Example primary color for light theme
        scaffoldBackgroundColor: Colors.white, // Light mode background color
        // Define other theme properties for light mode
        elevatedButtonTheme: ElevatedButtonThemeData(
          style: ElevatedButton.styleFrom(
            backgroundColor: Colors.blue, // Button color for light mode
            foregroundColor: Colors.black, // Text color for light mode
          ),
        ),
      ),
      darkTheme: ThemeData(
        brightness: Brightness.dark,
        primarySwatch: Colors.blueGrey, // Example primary color for dark theme
        scaffoldBackgroundColor: Colors.black, // Dark mode background color
        textTheme: const TextTheme(
          bodyLarge: TextStyle(color: Colors.white),
          bodyMedium: TextStyle(color: Colors.white),
          bodySmall: TextStyle(color: Colors.white),
          // Add other text styles as needed
        ),
        // Define other theme properties for dark mode
        elevatedButtonTheme: ElevatedButtonThemeData(
          style: ElevatedButton.styleFrom(
            backgroundColor: Colors.blueGrey, // Button color for dark mode
            foregroundColor: Colors.white, // Text color for dark mode
          ),
        ),
      ),
      themeMode: ThemeMode.system, // Use the system theme setting (light/dark)
      title: 'Mini Golf Score App',
      home: const MainMenu(),
    );
  }
}