prasule/lib/main.dart

49 lines
1.4 KiB
Dart
Raw Normal View History

2023-09-08 11:50:21 +02:00
import 'dart:io';
import 'package:dynamic_color/dynamic_color.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:logger/logger.dart';
import 'package:prasule/util/color_schemes.g.dart';
import 'package:prasule/views/home.dart';
void main() {
runApp(const MyApp());
}
final logger = Logger();
class MyApp extends StatelessWidget {
const MyApp({super.key});
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return (Platform.isAndroid)
? DynamicColorBuilder(
builder: (light, dark) => MaterialApp(
title: 'Prašule',
theme: ThemeData(
colorScheme: light ?? lightColorScheme,
useMaterial3: true,
),
darkTheme: ThemeData(
useMaterial3: true, colorScheme: dark ?? darkColorScheme),
home: const HomeView(),
),
)
: Theme(
data: ThemeData(
useMaterial3: true,
colorScheme: (MediaQuery.of(context).platformBrightness ==
Brightness.dark)
? darkColorScheme
: lightColorScheme),
2023-09-08 11:50:21 +02:00
child: const CupertinoApp(
title: 'Prašule',
home: HomeView(),
),
);
}
}