add geolocation View and controller and services, routes and bindings
This commit is contained in:
48
lib/routes/app_routes.dart
Normal file
48
lib/routes/app_routes.dart
Normal file
@@ -0,0 +1,48 @@
|
||||
import 'package:get/get.dart';
|
||||
import '../pages/examples/geolocation_example.dart';
|
||||
import '../bindings/geolocation_binding.dart';
|
||||
|
||||
/// App Routes Konfiguration
|
||||
class AppRoutes {
|
||||
static const String home = '/';
|
||||
static const String geolocation = '/geolocation';
|
||||
|
||||
/// Route Pages Definition
|
||||
static List<GetPage> pages = [
|
||||
GetPage(
|
||||
name: geolocation,
|
||||
page: () => const GeolocationExample(),
|
||||
binding: GeolocationBinding(), // Dependency Injection
|
||||
transition: Transition.cupertino,
|
||||
transitionDuration: const Duration(milliseconds: 300),
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
/// Route Namen als Konstanten für typsichere Navigation
|
||||
class Routes {
|
||||
static const String geolocationExample = '/geolocation-example';
|
||||
}
|
||||
|
||||
/// Navigation Helper Klasse
|
||||
class AppNavigation {
|
||||
/// Navigate to Geolocation Example
|
||||
static void toGeolocation() {
|
||||
Get.toNamed(AppRoutes.geolocation);
|
||||
}
|
||||
|
||||
/// Navigate back
|
||||
static void back() {
|
||||
Get.back();
|
||||
}
|
||||
|
||||
/// Navigate and replace current route
|
||||
static void offGeolocation() {
|
||||
Get.offNamed(AppRoutes.geolocation);
|
||||
}
|
||||
|
||||
/// Navigate and clear all previous routes
|
||||
static void offAllToGeolocation() {
|
||||
Get.offAllNamed(AppRoutes.geolocation);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user