|
|
@@ -88,25 +88,30 @@ class ZodiacLoveIntimacyController extends BaseController
|
|
|
final arguments = Get.arguments as Map<String, dynamic>?;
|
|
|
|
|
|
// 当前索引
|
|
|
- int tabIndex = ZodiacLoveIntimacyTab.today.tabIndex;
|
|
|
+ ZodiacLoveIntimacyTab? tab;
|
|
|
if (arguments?[AppPageArguments.index] == null) {
|
|
|
AtmobLog.i(_tag, '没有传递 index 参数');
|
|
|
} else {
|
|
|
final int? index = arguments?[AppPageArguments.index] as int?;
|
|
|
if (index != null) {
|
|
|
- tabIndex = index;
|
|
|
- AtmobLog.i(_tag, "index: $tabIndex");
|
|
|
+ tab = ZodiacLoveIntimacyTab.fromIndex(index);
|
|
|
+ if (tab != null) {
|
|
|
+ AtmobLog.i(_tag, "index: ${tab.tabIndex}");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ // 默认选中第一个Tab
|
|
|
+ tab ??= ZodiacLoveIntimacyTab.today;
|
|
|
+
|
|
|
// 创建PageController和TabController,并设置当前选中的index为初始索引
|
|
|
- pageController = PageController(initialPage: tabIndex);
|
|
|
+ pageController = PageController(initialPage: tab.tabIndex);
|
|
|
tabController = TabController(
|
|
|
- initialIndex: tabIndex,
|
|
|
+ initialIndex: tab.tabIndex,
|
|
|
length: tabBarList.length,
|
|
|
vsync: this,
|
|
|
);
|
|
|
- currentTabIndex.value = tabIndex;
|
|
|
+ currentTabIndex.value = tab.tabIndex;
|
|
|
}
|
|
|
|
|
|
/// 返回
|
|
|
@@ -126,7 +131,7 @@ class ZodiacLoveIntimacyController extends BaseController
|
|
|
pageController.animateToPage(
|
|
|
index,
|
|
|
duration: const Duration(milliseconds: 300),
|
|
|
- curve: Curves.easeInToLinear,
|
|
|
+ curve: Curves.fastOutSlowIn,
|
|
|
);
|
|
|
}
|
|
|
|