-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.dart
50 lines (39 loc) · 1.4 KB
/
main.dart
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
// Copyright 2020-2024 Tecdrop (https://www.tecdrop.com/)
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file or at
// https://www.tecdrop.com/colorhap/license/.
import 'package:flutter/material.dart';
import 'common/preferences.dart' as preferences;
import 'common/strings.dart' as strings;
import 'common/theme.dart';
import 'screens/random_color_screen.dart';
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
// if (kDebugMode) {
// // Check for duplicate attractive colors in the basic, web, and named colors lists
// checkForDuplicateAttractiveColors();
// }
// First try to load the app settings from Shared Preferences
await Future.any([
preferences.loadSettings(),
Future.delayed(const Duration(seconds: 5)),
]);
// Then run the app
runApp(const ColorHapApp());
}
/// The ColorHap main application class.
class ColorHapApp extends StatelessWidget {
const ColorHapApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: strings.appName,
debugShowCheckedModeBanner: false,
// A black on white theme to go with the color intensive interface of the app
theme: getAppTheme(Brightness.light),
// On dark mode, use a white on black theme
darkTheme: getAppTheme(Brightness.dark),
home: const RandomColorScreen(),
);
}
}