69 lines
2.0 KiB
Dart
69 lines
2.0 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter/services.dart';
|
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
|
|
import 'dart:io' show Platform;
|
|
import 'package:flutter/foundation.dart' show kIsWeb;
|
|
import 'package:window_manager/window_manager.dart';
|
|
|
|
// UI Imports
|
|
import 'ui/screens/splash/splash_screen.dart';
|
|
// Core Imports
|
|
import 'core/theme/app_theme.dart'; // Add this import
|
|
import 'ui/shared/widgets/inactivity_wrapper.dart';
|
|
|
|
void main() async {
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
|
|
if (!kIsWeb && (Platform.isWindows || Platform.isLinux || Platform.isMacOS)) {
|
|
await windowManager.ensureInitialized();
|
|
|
|
WindowOptions windowOptions = const WindowOptions(
|
|
size: Size(1280, 720),
|
|
minimumSize: Size(800, 600),
|
|
center: true,
|
|
backgroundColor: Colors.transparent,
|
|
skipTaskbar: false,
|
|
titleBarStyle: TitleBarStyle.hidden,
|
|
);
|
|
windowManager.waitUntilReadyToShow(windowOptions, () async {
|
|
await windowManager.show();
|
|
await windowManager.focus();
|
|
});
|
|
}
|
|
|
|
SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle(
|
|
systemNavigationBarColor: Colors.transparent,
|
|
statusBarColor: Colors.transparent,
|
|
));
|
|
SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
|
|
|
|
await SystemChrome.setPreferredOrientations([
|
|
DeviceOrientation.portraitUp,
|
|
DeviceOrientation.portraitDown,
|
|
]);
|
|
runApp(const ProviderScope(child: TisRmsApp()));
|
|
}
|
|
|
|
final GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>();
|
|
|
|
class TisRmsApp extends StatelessWidget {
|
|
const TisRmsApp({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return InactivityWrapper(
|
|
navigatorKey: navigatorKey,
|
|
child: MaterialApp(
|
|
navigatorKey: navigatorKey,
|
|
title: 'TIS RMS',
|
|
debugShowCheckedModeBanner: false,
|
|
|
|
// Clean, centralized theme reference!
|
|
theme: AppTheme.lightTheme,
|
|
|
|
home: const SplashScreen(),
|
|
),
|
|
);
|
|
}
|
|
} |