75 lines
2.1 KiB
Dart
75 lines
2.1 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:get/get.dart';
|
|
import 'routes/app_routes.dart';
|
|
import 'bindings/geolocation_binding.dart';
|
|
import 'pages/examples/geolocation_example.dart';
|
|
|
|
void main() {
|
|
runApp(const MyApp());
|
|
}
|
|
|
|
class MyApp extends StatelessWidget {
|
|
const MyApp({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return GetMaterialApp(
|
|
debugShowCheckedModeBanner: false,
|
|
title: 'Web Flutter Tank Appwrite App',
|
|
theme: ThemeData(
|
|
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
|
|
useMaterial3: true,
|
|
),
|
|
// GetX Konfiguration
|
|
initialRoute: AppRoutes.geolocation,
|
|
getPages: AppRoutes.pages,
|
|
initialBinding: GeolocationBinding(), // Optional: Globale Bindings
|
|
|
|
// Alternative: Direkte Navigation ohne Routen
|
|
//home: const GeolocationExample(),
|
|
|
|
// GetX Optionen
|
|
enableLog: true, // Debugging
|
|
defaultTransition: Transition.fade,
|
|
transitionDuration: const Duration(milliseconds: 300),
|
|
);
|
|
}
|
|
}
|
|
|
|
/// Alternative: Home Page mit Navigation zu Geolocation
|
|
class HomePage extends StatelessWidget {
|
|
const HomePage({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
appBar: AppBar(
|
|
title: const Text('Tank App'),
|
|
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
|
|
),
|
|
body: Center(
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: [
|
|
const Text(
|
|
'Tank Appwrite App',
|
|
style: TextStyle(fontSize: 24, fontWeight: FontWeight.bold),
|
|
),
|
|
const SizedBox(height: 32),
|
|
ElevatedButton.icon(
|
|
onPressed: () => Get.to(() => const GeolocationExample()),
|
|
icon: const Icon(Icons.location_on),
|
|
label: const Text('Geolocation Beispiel'),
|
|
style: ElevatedButton.styleFrom(
|
|
padding: const EdgeInsets.symmetric(
|
|
horizontal: 24,
|
|
vertical: 12,
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
} |