opt: rank page

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2024-11-24 16:42:24 +08:00
parent d3bd218718
commit 6c62cebdba

View File

@@ -30,22 +30,24 @@ class _RankPageState extends State<RankPage>
children: [ children: [
Expanded( Expanded(
flex: 18, flex: 18,
child: ListView.builder( child: SingleChildScrollView(
physics: const AlwaysScrollableScrollPhysics( padding: EdgeInsets.only(
parent: BouncingScrollPhysics(), bottom: MediaQuery.paddingOf(context).bottom + 80,
), ),
itemCount: _rankController.tabs.length, child: Column(
itemBuilder: (context, index) => IntrinsicHeight( children: List.generate(
child: Obx( _rankController.tabs.length,
() => InkWell( (index) => Obx(
() => IntrinsicHeight(
child: InkWell(
onTap: () { onTap: () {
_rankController.initialIndex.value = index; _rankController.initialIndex.value = index;
_rankController.tabController.animateTo(index); _rankController.tabController.animateTo(index);
}, },
child: Container( child: ColoredBox(
color: index == _rankController.initialIndex.value color: index == _rankController.initialIndex.value
? Theme.of(context).colorScheme.onInverseSurface ? Theme.of(context).colorScheme.onInverseSurface
: Colors.transparent, : Theme.of(context).colorScheme.surface,
child: Row( child: Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
@@ -60,14 +62,17 @@ class _RankPageState extends State<RankPage>
flex: 1, flex: 1,
child: Container( child: Container(
alignment: Alignment.center, alignment: Alignment.center,
padding: const EdgeInsets.symmetric(vertical: 10), padding:
const EdgeInsets.symmetric(vertical: 10),
child: Text( child: Text(
_rankController.tabs[index]['label'], _rankController.tabs[index]['label'],
style: TextStyle( style: TextStyle(
color: index == color: index ==
_rankController.initialIndex.value _rankController.initialIndex.value
? Theme.of(context).colorScheme.primary ? Theme.of(context).colorScheme.primary
: Theme.of(context).colorScheme.onSurface, : Theme.of(context)
.colorScheme
.onSurface,
fontSize: 15, fontSize: 15,
), ),
maxLines: 1, maxLines: 1,
@@ -83,6 +88,8 @@ class _RankPageState extends State<RankPage>
), ),
), ),
), ),
),
),
Expanded( Expanded(
flex: 82, flex: 82,
child: TabBarView( child: TabBarView(