Files
FlutterTravel/lib/main.dart
guruliciousjide@gmail.com edadaf53e1 first commit🛫
2019-07-02 01:26:30 +01:00

44 lines
1.1 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_travel_concept/screens/main_screen.dart';
import 'package:flutter_travel_concept/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 = true;
@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(),
);
}
}