mod: memberpage: anim to top

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2024-11-21 12:45:04 +08:00
parent f54859098c
commit c0a482ab78
3 changed files with 19 additions and 10 deletions

View File

@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
extension ImageExtension on num {
int cacheSize(BuildContext context) {
@@ -9,8 +10,12 @@ extension ImageExtension on num {
extension ScrollControllerExt on ScrollController {
void animToTop() {
if (!hasClients) return;
animateTo(0,
duration: const Duration(milliseconds: 500), curve: Curves.easeInOut);
if (offset >= MediaQuery.of(Get.context!).size.height * 7) {
jumpTo(0);
} else {
animateTo(0,
duration: const Duration(milliseconds: 500), curve: Curves.easeInOut);
}
}
}