-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.dart
56 lines (46 loc) · 1.44 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
51
52
53
54
55
56
import 'package:app/model/reminders.dart';
import 'package:app/notifications/notification_checker.dart';
import 'package:app/notifications/system_notification.dart';
import 'package:flutter/material.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/services.dart';
import 'package:permission_handler/permission_handler.dart';
import 'navigation_menu.dart';
import 'package:app/database/local_medicament_stock.dart';
import 'package:app/env/env.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp(
options: const FirebaseOptions(
apiKey: Env.API_KEY,
appId: Env.APP_ID,
messagingSenderId: Env.MESSAGING_SENDER_ID,
projectId: Env.PROJECT_ID
)
);
await ReminderDatabase().initDatabase();
await MedicamentStock().initDatabase();
await Permission.notification.isDenied.then((value) {
if (value) {
Permission.notification.request();
}
});
await SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
checkDayChangeInit();
await setTimersOnAppStart();
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'PinguPills',
theme: ThemeData(
primarySwatch: Colors.orange,
),
home: const NavigationMenu(),
debugShowCheckedModeBanner: false,
);
}
}