-
Notifications
You must be signed in to change notification settings - Fork 117
/
Copy pathmain.dart
39 lines (38 loc) · 1.27 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
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:noteapp/flavor.dart';
import 'package:noteapp/my_app.dart';
import 'package:noteapp/providers/auth_provider.dart';
import 'package:noteapp/providers/language_provider.dart';
import 'package:noteapp/providers/theme_provider.dart';
import 'package:noteapp/services/firestore_database.dart';
import 'package:provider/provider.dart';
void main() {
WidgetsFlutterBinding.ensureInitialized();
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp])
.then((_) async {
runApp(
/*
* MultiProvider for top services that do not depends on any runtime values
* such as user uid/email.
*/
MultiProvider(
providers: [
Provider<Flavor>.value(value: Flavor.dev),
ChangeNotifierProvider<ThemeProvider>(
create: (context) => ThemeProvider(),
),
ChangeNotifierProvider<AuthProvider>(
create: (context) => AuthProvider(),
),
ChangeNotifierProvider<LanguageProvider>(
create: (context) => LanguageProvider(),
),
],
child: MyApp(
databaseBuilder: (_, uid) => FirestoreDatabase(uid: uid),
),
),
);
});
}