mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-23 04:00:28 +08:00
scroll to current rank
Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
@@ -43,18 +43,22 @@ class _RankPageState extends State<RankPage>
|
||||
);
|
||||
}
|
||||
|
||||
static const double _tabHeight = 35.0;
|
||||
|
||||
Widget _buildTab(ThemeData theme) {
|
||||
return SizedBox(
|
||||
width: 64,
|
||||
child: Obx(() {
|
||||
final tabIndex = _rankController.tabIndex.value;
|
||||
return ListView.builder(
|
||||
controller: _rankController.tabScrollController,
|
||||
padding: .only(bottom: MediaQuery.paddingOf(context).bottom + 105),
|
||||
itemCount: RankType.values.length,
|
||||
itemBuilder: (context, index) {
|
||||
final item = RankType.values[index];
|
||||
final isCurr = index == tabIndex;
|
||||
return IntrinsicHeight(
|
||||
return SizedBox(
|
||||
height: _tabHeight,
|
||||
child: Material(
|
||||
color: isCurr
|
||||
? theme.colorScheme.onInverseSurface
|
||||
@@ -64,7 +68,8 @@ class _RankPageState extends State<RankPage>
|
||||
? _rankController.animateToTop
|
||||
: () => _rankController
|
||||
..tabIndex.value = index
|
||||
..tabController.animateTo(index),
|
||||
..tabController.animateTo(index)
|
||||
..scrollToCurrentIndex(_tabHeight, index),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
|
||||
Reference in New Issue
Block a user