mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-31 16:18:22 +08:00
@@ -26,60 +26,56 @@ class _RankPageState extends State<RankPage>
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 64,
|
||||
child: SingleChildScrollView(
|
||||
child: ListView(
|
||||
padding: EdgeInsets.only(
|
||||
bottom: MediaQuery.paddingOf(context).bottom + 80,
|
||||
),
|
||||
child: Column(
|
||||
children: List.generate(
|
||||
RankType.values.length,
|
||||
(index) => IntrinsicHeight(
|
||||
child: Obx(
|
||||
() => Ink(
|
||||
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,
|
||||
),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
children: List.generate(
|
||||
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,
|
||||
),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user