mirror of
https://github.com/JideGuru/FlutterTravel.git
synced 2025-08-06 15:21:15 +08:00
44 lines
1.1 KiB
Dart
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(),
|
|
);
|
|
}
|
|
}
|
|
|