mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-17 07:36:14 +08:00
fix: anim to top
This commit is contained in:
@@ -2,6 +2,7 @@ import 'dart:async';
|
|||||||
|
|
||||||
import 'package:PiliPalaX/models/common/dynamics_type.dart';
|
import 'package:PiliPalaX/models/common/dynamics_type.dart';
|
||||||
import 'package:PiliPalaX/models/common/up_panel_position.dart';
|
import 'package:PiliPalaX/models/common/up_panel_position.dart';
|
||||||
|
import 'package:PiliPalaX/pages/dynamics/tab/controller.dart';
|
||||||
import 'package:easy_debounce/easy_throttle.dart';
|
import 'package:easy_debounce/easy_throttle.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
@@ -128,32 +129,30 @@ class _DynamicsPageState extends State<DynamicsPage>
|
|||||||
: Brightness.light,
|
: Brightness.light,
|
||||||
),
|
),
|
||||||
title: SizedBox(
|
title: SizedBox(
|
||||||
height: 50,
|
height: 50,
|
||||||
child: TabBar(
|
child: TabBar(
|
||||||
controller: _dynamicsController.tabController,
|
controller: _dynamicsController.tabController,
|
||||||
isScrollable: true,
|
isScrollable: true,
|
||||||
dividerColor: Colors.transparent,
|
dividerColor: Colors.transparent,
|
||||||
dividerHeight: 0,
|
dividerHeight: 0,
|
||||||
tabAlignment: TabAlignment.center,
|
tabAlignment: TabAlignment.center,
|
||||||
indicatorColor: Theme.of(context).colorScheme.primary,
|
indicatorColor: Theme.of(context).colorScheme.primary,
|
||||||
labelColor: Theme.of(context).colorScheme.primary,
|
labelColor: Theme.of(context).colorScheme.primary,
|
||||||
unselectedLabelColor: Theme.of(context).colorScheme.onSurface,
|
unselectedLabelColor: Theme.of(context).colorScheme.onSurface,
|
||||||
labelStyle: TextStyle(
|
labelStyle: TextStyle(
|
||||||
fontSize: Theme.of(context).textTheme.labelMedium!.fontSize,
|
fontSize: Theme.of(context).textTheme.labelMedium!.fontSize,
|
||||||
),
|
),
|
||||||
tabs: DynamicsType.values
|
tabs:
|
||||||
.map((e) => Tab(text: e.labels))
|
DynamicsType.values.map((e) => Tab(text: e.labels)).toList(),
|
||||||
.toList(),
|
onTap: (index) {
|
||||||
onTap: (index) {
|
if (!_dynamicsController.tabController.indexIsChanging) {
|
||||||
print('index: $index');
|
feedBack();
|
||||||
feedBack();
|
Get.find<DynamicsTabController>(tag: tabsConfig[index]['tag'])
|
||||||
tabsConfig[_dynamicsController.tabController.index]['ctr']
|
.animateToTop();
|
||||||
.animateToTop();
|
}
|
||||||
// _dynamicsController.tabController
|
},
|
||||||
// _dynamicsController.tabController.index = index;
|
),
|
||||||
// _dynamicsController.onSelectType(index);
|
),
|
||||||
// _
|
|
||||||
})),
|
|
||||||
),
|
),
|
||||||
drawer: upPanelPosition == UpPanelPosition.leftDrawer
|
drawer: upPanelPosition == UpPanelPosition.leftDrawer
|
||||||
? SafeArea(child: upPanelPart())
|
? SafeArea(child: upPanelPart())
|
||||||
|
|||||||
Reference in New Issue
Block a user