voyagehandbook/lib/main.dart

45 lines
1.5 KiB
Dart
Raw Normal View History

2023-03-18 16:55:08 +01:00
import 'package:dynamic_color/dynamic_color.dart';
2023-03-16 14:57:15 +01:00
import 'package:flutter/material.dart';
2023-03-18 16:55:08 +01:00
import 'package:voyagehandbook/util/color_schemes.g.dart';
import 'package:voyagehandbook/views/home.dart';
2023-03-16 14:57:15 +01:00
2023-03-27 19:45:57 +02:00
/*
Voyage Handbook - The open-source WikiVoyage reader
Copyright (C) 2023 Matyáš Caras
This program is free software: you can redistribute it and/or modify
2023-03-28 20:10:46 +02:00
it under the terms of the GNU General Public License version 3 as published by
the Free Software Foundation.
2023-03-27 19:45:57 +02:00
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
2023-03-16 14:57:15 +01:00
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
2023-03-18 16:55:08 +01:00
return DynamicColorBuilder(
builder: (lightDynamic, darkDynamic) => MaterialApp(
title: 'Voyage Handbook',
theme: ThemeData(
2023-03-27 19:45:57 +02:00
useMaterial3: true, colorScheme: lightDynamic ?? lightColorScheme),
2023-03-18 16:55:08 +01:00
darkTheme: ThemeData(
2023-03-27 19:45:57 +02:00
useMaterial3: true, colorScheme: darkDynamic ?? darkColorScheme),
2023-03-18 16:55:08 +01:00
home: const HomeView(),
2023-03-16 14:57:15 +01:00
),
);
}
}