mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-15 05:33:59 +08:00
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user