Browse Source

防止在当前页面重复跳转

newdev_shunjiawei
lxm 2 years ago
parent
commit
843cdeb0ae
  1. 1
      lib/core/widgets/common_bottom_nav.dart

1
lib/core/widgets/common_bottom_nav.dart

@ -18,6 +18,7 @@ class CommonBottomNav extends StatelessWidget {
currentIndex: currentIndex, currentIndex: currentIndex,
onTap: (index) { onTap: (index) {
// Navigate to the appropriate page based on index // Navigate to the appropriate page based on index
if(index ==currentIndex) return;//如果是当前页面,不跳转
switch (index) { switch (index) {
case 0: case 0:
Get.offAllNamed(Routes.home); Get.offAllNamed(Routes.home);

Loading…
Cancel
Save