58 lines
1.9 KiB
Dart
58 lines
1.9 KiB
Dart
import 'package:flutter/foundation.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:device_preview/device_preview.dart';
|
|
import 'package:flutter/services.dart';
|
|
import './utils/router.dart';
|
|
import './utils/global.dart';
|
|
|
|
void main() {
|
|
runApp(const MyApp());
|
|
}
|
|
|
|
// void main() => runApp(
|
|
// DevicePreview(
|
|
// enabled: !kReleaseMode,
|
|
// builder: (context) => const MyApp(), // Wrap your app
|
|
// ),
|
|
// );
|
|
|
|
class MyApp extends StatelessWidget {
|
|
const MyApp({super.key});
|
|
|
|
// This widget is the root of your application.
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final mediaQueryData =
|
|
MediaQueryData.fromWindow(WidgetsBinding.instance.window);
|
|
screenWidth = mediaQueryData.size.width;
|
|
screenHeight = mediaQueryData.size.height;
|
|
blockSizeHorizontal = screenWidth / 100;
|
|
blockSizeVertical = screenHeight / 100;
|
|
safeAreaHorizontal =
|
|
mediaQueryData.padding.left + mediaQueryData.padding.right;
|
|
safeAreaVertical =
|
|
mediaQueryData.padding.top + mediaQueryData.padding.bottom;
|
|
safeBlockHorizontal = (screenWidth - safeAreaHorizontal) / 100;
|
|
safeBlockVertical = (screenHeight - safeAreaVertical) / 100;
|
|
|
|
return MaterialApp.router(
|
|
// useInheritedMediaQuery: true,
|
|
// locale: DevicePreview.locale(context),
|
|
// builder: DevicePreview.appBuilder,
|
|
routeInformationParser: goRouter.routeInformationParser,
|
|
routerDelegate: goRouter.routerDelegate,
|
|
// routeInformationProvider: goRouter.routeInformationProvider,
|
|
title: 'uniT2 - Universal Tracker and Tracer',
|
|
theme: ThemeData(
|
|
appBarTheme: const AppBarTheme(
|
|
systemOverlayStyle: SystemUiOverlayStyle(
|
|
statusBarBrightness: Brightness.dark,
|
|
statusBarColor: Colors.black),
|
|
),
|
|
fontFamily: 'LexendDeca',
|
|
),
|
|
debugShowCheckedModeBanner: false,
|
|
);
|
|
}
|
|
}
|