74 lines
1.8 KiB
Dart
74 lines
1.8 KiB
Dart
import 'package:get/get.dart';
|
|
import '../bindings/input_binding.dart';
|
|
import '../bindings/login_binding.dart';
|
|
import '../pages/input/input_view.dart';
|
|
import '../pages/login/login_view.dart';
|
|
|
|
/// App Routes Konfiguration
|
|
class AppRoutes {
|
|
static const String login = '/login';
|
|
static const String listPage = '/list-page';
|
|
static const String inputPage = '/input-page';
|
|
|
|
/// Route Pages Definition
|
|
static List<GetPage> pages = [
|
|
GetPage(
|
|
name: login,
|
|
page: () => const LoginPage(),
|
|
binding: LoginBinding(), // Dependency Injection
|
|
transition: Transition.cupertino,
|
|
transitionDuration: const Duration(milliseconds: 300),
|
|
),
|
|
GetPage(
|
|
name: inputPage,
|
|
page: () => const InputPage(),
|
|
binding: InputBinding(), // 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 {
|
|
|
|
|
|
/// Login Navigation Methods
|
|
/// Navigate to Login Page
|
|
static void toLogin() {
|
|
Get.toNamed(AppRoutes.login);
|
|
}
|
|
/// Navigate and replace current route
|
|
static void offLogin() {
|
|
Get.offNamed(AppRoutes.login);
|
|
}
|
|
/// Navigate and clear all previous routes
|
|
static void offAllToLogin() {
|
|
Get.offAllNamed(AppRoutes.login);
|
|
}
|
|
|
|
/// Input Navigation Methods
|
|
/// Navigate to Input Page
|
|
static void toInputPage() {
|
|
Get.toNamed(AppRoutes.inputPage);
|
|
}
|
|
|
|
/// Navigate to Input Page with args
|
|
static void toInputPageWithArgs(Object args) {
|
|
Get.toNamed(AppRoutes.inputPage, arguments: args);
|
|
}
|
|
|
|
|
|
|
|
/// Navigate back
|
|
static void back() {
|
|
Get.back();
|
|
}
|
|
|
|
} |