mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: spring
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -423,8 +423,7 @@ class _ListSheetContentState extends State<ListSheetContent>
|
||||
child: _isList
|
||||
? Material(
|
||||
color: Colors.transparent,
|
||||
child: TabBarView(
|
||||
physics: customTabBarViewScrollPhysics,
|
||||
child: tabBarView(
|
||||
controller: _ctr,
|
||||
children: List.generate(
|
||||
widget.season.sections.length,
|
||||
|
||||
@@ -1,5 +1,15 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:PiliPlus/utils/storage.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
Widget tabBarView({
|
||||
required List<Widget> children,
|
||||
TabController? controller,
|
||||
}) =>
|
||||
TabBarView(
|
||||
physics: customTabBarViewScrollPhysics,
|
||||
controller: controller,
|
||||
children: children,
|
||||
);
|
||||
|
||||
class CustomTabBarViewScrollPhysics extends ScrollPhysics {
|
||||
CustomTabBarViewScrollPhysics({super.parent});
|
||||
@@ -9,12 +19,14 @@ class CustomTabBarViewScrollPhysics extends ScrollPhysics {
|
||||
return CustomTabBarViewScrollPhysics(parent: buildParent(ancestor)!);
|
||||
}
|
||||
|
||||
final springDescription = GStorage.springDescription;
|
||||
|
||||
@override
|
||||
SpringDescription spring = SpringDescription(
|
||||
mass: GStorage.springDescription[0],
|
||||
stiffness: GStorage.springDescription[1],
|
||||
damping: GStorage.springDescription[2]
|
||||
);
|
||||
SpringDescription get spring => SpringDescription(
|
||||
mass: springDescription[0],
|
||||
stiffness: springDescription[1],
|
||||
damping: springDescription[2],
|
||||
);
|
||||
}
|
||||
|
||||
final customTabBarViewScrollPhysics = CustomTabBarViewScrollPhysics();
|
||||
final customTabBarViewScrollPhysics = CustomTabBarViewScrollPhysics();
|
||||
|
||||
Reference in New Issue
Block a user