feat: 增加侧滑事件

This commit is contained in:
2025-12-02 06:09:25 -08:00
parent 8e27ddeded
commit e82480b937
13 changed files with 669 additions and 250 deletions
+43 -21
View File
@@ -43,6 +43,7 @@ import '../modules/kr_splash/views/kr_splash_view.dart';
import '../modules/kr_device_management/bindings/kr_device_management_binding.dart';
import '../modules/kr_device_management/views/kr_device_management_view.dart';
import 'package:kaer_with_panels/app/routes/transitions/slide_transparent_transition.dart';
import 'package:kaer_with_panels/app/widgets/swipe/swipe_wrapper.dart';
part 'app_routes.dart';
@@ -54,20 +55,23 @@ class AppPages {
static final routes = [
GetPage(
name: Routes.KR_SPLASH,
page: () => const KRSplashView(),
page: () => SwipeWrapper.detect(() => const KRSplashView()),
binding: KRSplashBinding(),
popGesture: false,
transition: Transition.fade,
transitionDuration: const Duration(milliseconds: 500),
),
GetPage(
name: _Paths.KR_MAIN,
page: () => const KRMainView(),
page: () => SwipeWrapper.detect(() => const KRMainView()),
binding: KRMainBinding(),
popGesture: false,
),
GetPage(
name: _Paths.KR_HOME,
page: () => KRHomeView(),
page: () => SwipeWrapper.detect(() => KRHomeView()),
binding: KRHomeBinding(),
popGesture: false,
arguments: {'showSubscriptionButton': true}, // 显示购买按钮
customTransition: SlideOutOnlyTransition(
direction: SlideDirection.leftToRight,
@@ -76,8 +80,9 @@ class AppPages {
),
GetPage(
name: _Paths.HI_MENU,
page: () => const HIMenuView(),
page: () => SwipeWrapper.detect(() => const HIMenuView()),
binding: HIMenuBinding(),
popGesture: false,
arguments: {'showSubscriptionButton': true}, // 显示购买按钮
customTransition: ContextAwareSlideTransition(
targetRoute: _Paths.HI_MENU,
@@ -86,90 +91,107 @@ class AppPages {
),
GetPage(
name: _Paths.MR_LOGIN,
page: () => const KRLoginView(),
page: () => SwipeWrapper.detect(() => const KRLoginView()),
binding: MrLoginBinding(),
popGesture: false,
arguments: {'showSubscriptionButton': true}, // 显示购买按钮
),
GetPage(
name: _Paths.KR_SETTING,
page: () => const KRSettingView(),
page: () => SwipeWrapper.detect(() => const KRSettingView()),
binding: KRSettingBinding(),
popGesture: false,
),
GetPage(
name: _Paths.KR_USER_INFO,
page: () => const KRUserInfoView(),
page: () => SwipeWrapper.detect(() => const KRUserInfoView()),
binding: KRUserInfoBinding(),
popGesture: false,
),
GetPage(
name: _Paths.KR_INVITE,
page: () => const KRInviteView(),
page: () => SwipeWrapper.detect(() => const KRInviteView()),
binding: KRInviteBinding(),
popGesture: false,
),
GetPage(
name: _Paths.KR_STATISTICS,
page: () => const KRStatisticsView(),
page: () => SwipeWrapper.detect(() => const KRStatisticsView()),
binding: KRStatisticsBinding(),
popGesture: false,
),
GetPage(
name: _Paths.KR_LANGUAGE_SELECTOR,
page: () => const KRLanguageSelectorView(),
page: () => SwipeWrapper.detect(() => const KRLanguageSelectorView()),
binding: KRLanguageSelectorBinding(),
popGesture: false,
),
GetPage(
name: _Paths.KR_COUNTRY_SELECTOR,
page: () => const KRCountrySelectorView(),
page: () => SwipeWrapper.detect(() => const KRCountrySelectorView()),
binding: KRCountrySelectorBinding(),
popGesture: false,
),
GetPage(
name: _Paths.KR_PURCHASE_MEMBERSHIP,
page: () => const KRPurchaseMembershipView(),
page: () => SwipeWrapper.detect(() => const KRPurchaseMembershipView()),
binding: KRPurchaseMembershipBinding(),
popGesture: false,
arguments: {'showSubscriptionButton': true}, // 显示购买按钮
),
GetPage(
name: _Paths.KR_MESSAGE,
page: () => const KRMessageView(),
page: () => SwipeWrapper.detect(() => const KRMessageView()),
binding: KrMessageBinding(),
popGesture: false,
),
GetPage(
name: _Paths.KR_DELETE_ACCOUNT,
page: () => const KRDeleteAccountView(),
page: () => SwipeWrapper.detect(() => const KRDeleteAccountView()),
binding: KrDeleteAccountBinding(),
popGesture: false,
),
GetPage(
name: Routes.KR_WEBVIEW,
page: () => const KRWebView(),
page: () => SwipeWrapper.detect(() => const KRWebView()),
binding: KRWebViewBinding(),
popGesture: false,
),
GetPage(
name: Routes.KR_ORDER_STATUS,
page: () => const KROrderStatusView(),
page: () => SwipeWrapper.detect(() => const KROrderStatusView()),
binding: KROrderStatusBinding(),
popGesture: false,
),
GetPage(
name: _Paths.KR_CRISP,
page: () => const KRCrispView(),
page: () => SwipeWrapper.detect(() => const KRCrispView()),
binding: KRCrispBinding(),
popGesture: false,
),
GetPage(
name: _Paths.KR_DEVICE_MANAGEMENT,
page: () => const KRDeviceManagementView(),
page: () => SwipeWrapper.detect(() => const KRDeviceManagementView()),
binding: KRDeviceManagementBinding(),
popGesture: false,
),
GetPage(
name: _Paths.HI_NODE_LIST,
page: () => const HINodePageView(),
page: () => SwipeWrapper.detect(() => const HINodePageView()),
binding: HiNodeListBinding(),
popGesture: false,
),
GetPage(
name: _Paths.HI_HELP,
page: () => const HIHelpView(),
page: () => SwipeWrapper.detect(() => const HIHelpView()),
binding: HIHelpBinding(),
popGesture: false,
),
GetPage(
name: _Paths.HI_USER_INFO,
page: () => const HIUserInfoView(),
page: () => SwipeWrapper.detect(() => const HIUserInfoView()),
binding: HIUserInfoBinding(),
popGesture: false,
arguments: {'showSubscriptionButton': true}, // 显示购买按钮
),
];