2022-11-28 08:03:13 +00:00
|
|
|
import 'package:flutter/foundation.dart';
|
2022-11-28 02:26:36 +00:00
|
|
|
import 'package:flutter/material.dart';
|
2022-11-28 08:03:13 +00:00
|
|
|
import 'package:device_preview/device_preview.dart';
|
2022-12-05 08:06:45 +00:00
|
|
|
import 'package:flutter/services.dart';
|
2022-11-28 08:03:13 +00:00
|
|
|
import './utils/router.dart';
|
|
|
|
import './utils/global.dart';
|
2022-11-28 02:26:36 +00:00
|
|
|
|
|
|
|
void main() {
|
|
|
|
runApp(const MyApp());
|
|
|
|
}
|
|
|
|
|
2022-11-28 08:03:13 +00:00
|
|
|
// void main() => runApp(
|
|
|
|
// DevicePreview(
|
|
|
|
// enabled: !kReleaseMode,
|
|
|
|
// builder: (context) => const MyApp(), // Wrap your app
|
|
|
|
// ),
|
|
|
|
// );
|
|
|
|
|
2022-11-28 02:26:36 +00:00
|
|
|
class MyApp extends StatelessWidget {
|
|
|
|
const MyApp({super.key});
|
|
|
|
|
|
|
|
// This widget is the root of your application.
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
2022-11-28 08:03:13 +00:00
|
|
|
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;
|
2022-12-05 08:06:45 +00:00
|
|
|
|
2022-11-28 08:03:13 +00:00
|
|
|
return MaterialApp.router(
|
|
|
|
// useInheritedMediaQuery: true,
|
|
|
|
// locale: DevicePreview.locale(context),
|
|
|
|
// builder: DevicePreview.appBuilder,
|
|
|
|
routeInformationParser: goRouter.routeInformationParser,
|
2022-12-05 08:06:45 +00:00
|
|
|
routerDelegate: goRouter.routerDelegate,
|
|
|
|
// routeInformationProvider: goRouter.routeInformationProvider,
|
2022-11-28 08:03:13 +00:00
|
|
|
title: 'uniT2 - Universal Tracker and Tracer',
|
2022-11-28 02:26:36 +00:00
|
|
|
theme: ThemeData(
|
2022-12-05 08:06:45 +00:00
|
|
|
appBarTheme: const AppBarTheme(
|
|
|
|
systemOverlayStyle: SystemUiOverlayStyle(
|
|
|
|
statusBarBrightness: Brightness.dark,
|
|
|
|
statusBarColor: Colors.black),
|
|
|
|
),
|
2022-11-28 08:03:13 +00:00
|
|
|
fontFamily: 'LexendDeca',
|
2022-11-28 02:26:36 +00:00
|
|
|
),
|
2022-11-28 08:03:13 +00:00
|
|
|
debugShowCheckedModeBanner: false,
|
2022-11-28 02:26:36 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|