2025-05-11 13:13:51 -07:00
|
|
|
import 'package:firebase_core/firebase_core.dart';
|
|
|
|
|
import 'package:firebase_crashlytics/firebase_crashlytics.dart';
|
2025-05-04 17:47:47 -07:00
|
|
|
import 'package:flutter/material.dart';
|
2025-05-05 18:18:36 -07:00
|
|
|
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
2025-05-10 09:51:51 -07:00
|
|
|
import 'package:flutter_background_geolocation/flutter_background_geolocation.dart' as bg;
|
2025-05-10 11:16:46 -07:00
|
|
|
import 'package:traccar_client/quick_actions.dart';
|
2025-05-05 18:18:36 -07:00
|
|
|
|
|
|
|
|
import 'main_screen.dart';
|
2025-05-05 22:43:43 -07:00
|
|
|
import 'preferences.dart';
|
2025-05-04 17:47:47 -07:00
|
|
|
|
2025-05-05 22:43:43 -07:00
|
|
|
void main() async {
|
|
|
|
|
WidgetsFlutterBinding.ensureInitialized();
|
2025-05-11 13:13:51 -07:00
|
|
|
await Firebase.initializeApp();
|
|
|
|
|
FlutterError.onError = FirebaseCrashlytics.instance.recordFlutterFatalError;
|
2025-05-05 22:43:43 -07:00
|
|
|
await Preferences.init();
|
2025-05-10 09:51:51 -07:00
|
|
|
await bg.BackgroundGeolocation.ready(Preferences.geolocationConfig());
|
2025-05-04 17:47:47 -07:00
|
|
|
runApp(const MainApp());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class MainApp extends StatelessWidget {
|
|
|
|
|
const MainApp({super.key});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
2025-05-07 22:06:29 -07:00
|
|
|
return MaterialApp(
|
2025-05-05 18:18:36 -07:00
|
|
|
localizationsDelegates: AppLocalizations.localizationsDelegates,
|
|
|
|
|
supportedLocales: AppLocalizations.supportedLocales,
|
2025-05-07 22:06:29 -07:00
|
|
|
theme: ThemeData(
|
|
|
|
|
colorScheme: ColorScheme.fromSeed(
|
|
|
|
|
seedColor: Colors.green,
|
2025-05-20 17:48:08 -07:00
|
|
|
brightness: Brightness.light,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
darkTheme: ThemeData(
|
|
|
|
|
colorScheme: ColorScheme.fromSeed(
|
|
|
|
|
seedColor: Colors.green,
|
|
|
|
|
brightness: Brightness.dark,
|
2025-05-07 22:06:29 -07:00
|
|
|
),
|
|
|
|
|
),
|
2025-05-10 11:16:46 -07:00
|
|
|
home: Stack(
|
|
|
|
|
children: const [
|
|
|
|
|
QuickActionsInitializer(),
|
|
|
|
|
MainScreen(),
|
|
|
|
|
],
|
|
|
|
|
),
|
2025-05-04 17:47:47 -07:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|