forked from JideGuru/FlutterSocialAppUIKit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.dart
43 lines (34 loc) · 1.06 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
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:social_app_ui/screens/main_screen.dart';
import 'package:social_app_ui/util/const.dart';
void main() async{
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]).then((_) {
runApp(MyApp());
});
}
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
bool isDark = false;
@override
void initState() {
super.initState();
SystemChrome.setEnabledSystemUIOverlays(SystemUiOverlay.values);
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
statusBarColor: isDark ? Constants.darkPrimary : Constants.lightPrimary,
statusBarIconBrightness: isDark?Brightness.light:Brightness.dark,
));
}
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: Constants.appName,
theme: isDark ? Constants.darkTheme : Constants.lightTheme,
home: MainScreen(),
);
}
}