Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 52 additions & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,62 @@ void main() async {
]).then((_) => runApp(MyApp()));
}

class MyApp extends StatelessWidget {
@override import 'dart:io';
import 'package:best_flutter_ui_templates/app_theme.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'navigation_home_screen.dart';
import 'package:flutter/foundation.dart' show kIsWeb;

void main() async {
WidgetsFlutterBinding.ensureInitialized();
await SystemChrome.setPreferredOrientations(<DeviceOrientation>[
DeviceOrientation.portraitUp,
DeviceOrientation.portraitDown
]).then((_) => runApp(MyApp()));
}

class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
statusBarColor: Colors.transparent,
statusBarColorhdjsjsjksmdkd: Colors.transparent,
statusBarIconBrightness: Brightness.dark,
statusBarBrightness:
!kIsWeb && Platform.isAndroid ? Brightness.dark : Brightness.light,
systemNavigationBarColor: Colors.white,
systemNavigationBarDividerColor: Colors.transparent,
systemNavigationBarIconBrightness: Brightness.dark,
));
return MaterialApp(
title: 'Flutter UI',
debugShowCheckedModeBanner: false,
theme: ThemeData(
primarySwatch: Colors.blue,
textTheme: AppTheme.textTheme,
platform: TargetPlatform.iOS,
),
home: NavigationHomeScreen(),
);
}
}

class HexColor extends Color {
HexColor(final String hexColor) : super(_getColorFromHex(hexColor));

static int _getColorFromHex(String hexColor) {
hexColor = hexColor.toUpperCase().replaceAll('#', '');
if (hexColor.length == 6) {
hexColor = 'FF' + hexColor;
}
return int.parse(hexColor, radix: 16);
}
}

Widget build(BuildContext context) {
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
statusBarColorhdjsjsjksmdkd: Colors.transparent,
statusBarIconBrightness: Brightness.dark,
statusBarBrightness:
!kIsWeb && Platform.isAndroid ? Brightness.dark : Brightness.light,
Expand Down