Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-07-22 21:13:16 +08:00
parent 55bed2e830
commit e770e39c8f
59 changed files with 1388 additions and 1265 deletions

View File

@@ -34,51 +34,56 @@ class _RankPageState extends State<RankPage>
RankType.values.length,
(index) => IntrinsicHeight(
child: Obx(
() => Material(
color: index == _rankController.tabIndex.value
? theme.colorScheme.onInverseSurface
: theme.colorScheme.surface,
child: InkWell(
onTap: () {
if (_rankController.tabIndex.value != index) {
_rankController.tabIndex.value = index;
_rankController.tabController.animateTo(index);
} else {
_rankController.animateToTop();
}
},
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Container(
height: double.infinity,
width: 3,
color: index == _rankController.tabIndex.value
? theme.colorScheme.primary
: Colors.transparent,
),
Expanded(
flex: 1,
child: Container(
alignment: Alignment.center,
padding: const EdgeInsets.symmetric(vertical: 7),
child: Text(
RankType.values[index].label,
style: TextStyle(
color: index == _rankController.tabIndex.value
? theme.colorScheme.primary
: theme.colorScheme.onSurface,
fontSize: 15,
() {
final isCurr = index == _rankController.tabIndex.value;
return Material(
color: isCurr
? theme.colorScheme.onInverseSurface
: theme.colorScheme.surface,
child: InkWell(
onTap: () {
if (isCurr) {
_rankController.animateToTop();
} else {
_rankController
..tabIndex.value = index
..tabController.animateTo(index);
}
},
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Container(
height: double.infinity,
width: 3,
color: isCurr
? theme.colorScheme.primary
: Colors.transparent,
),
Expanded(
flex: 1,
child: Container(
alignment: Alignment.center,
padding:
const EdgeInsets.symmetric(vertical: 7),
child: Text(
RankType.values[index].label,
style: TextStyle(
color: isCurr
? theme.colorScheme.primary
: theme.colorScheme.onSurface,
fontSize: 15,
),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
),
),
],
],
),
),
),
),
);
},
),
),
),