mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
@@ -2,7 +2,6 @@ import 'dart:async';
|
||||
|
||||
import 'package:PiliPlus/http/loading_state.dart';
|
||||
import 'package:PiliPlus/utils/extension.dart';
|
||||
import 'package:easy_debounce/easy_throttle.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
@@ -12,19 +11,6 @@ abstract mixin class 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