reresh_config.dart 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import 'package:easy_refresh/easy_refresh.dart';
  2. class RefreshConfig {
  3. RefreshConfig._();
  4. static RefreshConfig? _instance;
  5. static RefreshConfig get() => _instance ?? RefreshConfig._();
  6. void initDefault({
  7. ClassicHeader? header,
  8. ClassicFooter? footer,
  9. }) {
  10. EasyRefresh.defaultHeaderBuilder = () =>
  11. header ??
  12. const ClassicHeader(
  13. dragText: '下拉刷新',
  14. armedText: '释放开始',
  15. readyText: '刷新中...',
  16. processingText: '刷新中...',
  17. processedText: '成功了',
  18. noMoreText: '已加载全部',
  19. failedText: '刷新失败',
  20. messageText: '最后更新于 %T',
  21. processedDuration: Duration(milliseconds: 200),
  22. );
  23. EasyRefresh.defaultFooterBuilder = () =>
  24. footer ??
  25. const ClassicFooter(
  26. dragText: '上拉加载',
  27. armedText: '释放开始',
  28. readyText: '加载中...',
  29. processingText: '加载中...',
  30. processedText: '成功了',
  31. noMoreText: '已加载全部',
  32. failedText: '加载失败',
  33. messageText: '最后更新于 %T',
  34. processedDuration: Duration(milliseconds: 200),
  35. );
  36. }
  37. }