Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-05-02 10:36:29 +08:00
parent 05668912f6
commit b89b822d5e
3 changed files with 12 additions and 57 deletions

View File

@@ -2,7 +2,6 @@ import 'dart:async';
import 'package:PiliPlus/http/loading_state.dart';
import 'package:PiliPlus/utils/extension/scroll_controller_ext.dart';
import 'package:easy_debounce/easy_throttle.dart';
import 'package:flutter/widgets.dart' show ScrollController;
import 'package:get/get.dart';
@@ -12,20 +11,6 @@ mixin ScrollOrRefreshMixin {
void animateToTop() => scrollController.animToTop();
Future<void> onRefresh();
void toTopOrRefresh() {
if (scrollController.hasClients) {
if (scrollController.position.pixels == 0) {
EasyThrottle.throttle(
'topOrRefresh',
const Duration(milliseconds: 500),
onRefresh,
);
} else {
animateToTop();
}
}
}
}
abstract class CommonController<R, T> extends GetxController