56 lines
1.8 KiB
Dart
56 lines
1.8 KiB
Dart
import 'dart:io';
|
|
|
|
import 'package:dynamic_color/dynamic_color.dart';
|
|
import 'package:flutter/cupertino.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_localizations/flutter_localizations.dart';
|
|
import 'package:logger/logger.dart';
|
|
import 'package:prasule/util/color_schemes.g.dart';
|
|
import 'package:prasule/views/home.dart';
|
|
import 'package:flutter_gen/gen_l10n/app_localizations.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(
|
|
localizationsDelegates: const [
|
|
AppLocalizations.delegate,
|
|
...GlobalMaterialLocalizations.delegates,
|
|
...GlobalCupertinoLocalizations.delegates
|
|
],
|
|
supportedLocales: AppLocalizations.supportedLocales,
|
|
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),
|
|
child: const CupertinoApp(
|
|
title: 'Prašule',
|
|
home: HomeView(),
|
|
),
|
|
);
|
|
}
|
|
}
|