trcr/lib/main.dart

32 lines
882 B
Dart
Raw Normal View History

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-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();
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-05 07:47:09 -07:00
home: MainScreen(),
2025-05-04 17:47:47 -07:00
);
}
}