uninav/lib/main.dart

51 lines
1.4 KiB
Dart
Raw Normal View History

2024-04-19 18:07:54 +00:00
import 'package:flutter/material.dart';
2024-04-21 06:24:50 +00:00
import 'package:flutter/services.dart';
2024-04-20 14:32:01 +00:00
import 'package:get/get.dart';
2024-04-21 00:22:53 +00:00
import 'package:uninav/controllers/isar_controller.dart';
2024-04-20 14:32:01 +00:00
import 'package:uninav/controllers/map_controller.dart';
2024-04-19 18:07:54 +00:00
import 'package:uninav/map.dart';
2024-04-20 14:32:01 +00:00
import 'package:uninav/settings.dart';
2024-04-19 18:07:54 +00:00
2024-04-21 00:22:53 +00:00
// TODO: maybe make not async?
void main() async {
2024-04-20 14:32:01 +00:00
Get.put(MyMapController());
2024-04-21 06:24:50 +00:00
await Get.find<MyMapController>()
.loadGeoJson(await rootBundle.loadString('assets/geo/uulm_beta.geojson'));
2024-04-21 00:22:53 +00:00
await Get.putAsync(() async {
final controller = IsarController();
await controller.initializeIsar();
return controller;
});
2024-04-19 18:07:54 +00:00
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return GetMaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
2024-04-20 22:35:16 +00:00
darkTheme: ThemeData.dark(
useMaterial3: true,
).copyWith(
colorScheme: ColorScheme.fromSeed(
brightness: Brightness.dark,
seedColor: Colors.deepPurple,
),
),
2024-04-20 14:32:01 +00:00
initialRoute: '/map',
getPages: [
GetPage(name: '/map', page: () => const MapPage()),
GetPage(name: '/settings', page: () => const SettingsPage()),
],
2024-04-19 18:07:54 +00:00
);
}
}