mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-17 07:36:14 +08:00
feat: custom spring (#304)
This commit is contained in:
committed by
GitHub
parent
6506afa732
commit
b2c520bd91
20
lib/common/widgets/spring_physics.dart
Normal file
20
lib/common/widgets/spring_physics.dart
Normal file
@@ -0,0 +1,20 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:PiliPlus/utils/storage.dart';
|
||||
|
||||
class CustomTabBarViewScrollPhysics extends ScrollPhysics {
|
||||
CustomTabBarViewScrollPhysics({super.parent});
|
||||
|
||||
@override
|
||||
CustomTabBarViewScrollPhysics applyTo(ScrollPhysics? ancestor) {
|
||||
return CustomTabBarViewScrollPhysics(parent: buildParent(ancestor)!);
|
||||
}
|
||||
|
||||
@override
|
||||
SpringDescription spring = SpringDescription(
|
||||
mass: GStorage.springDescription[0],
|
||||
stiffness: GStorage.springDescription[1],
|
||||
damping: GStorage.springDescription[2]
|
||||
);
|
||||
}
|
||||
|
||||
final customTabBarViewScrollPhysics = CustomTabBarViewScrollPhysics();
|
||||
Reference in New Issue
Block a user