-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsmart_refresh.dart
79 lines (79 loc) · 2.62 KB
/
smart_refresh.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
// import 'package:easy_localization/easy_localization.dart';
// import 'package:flutter/cupertino.dart';
// import 'package:flutter/material.dart';
// import 'package:futara/view/widgets/my_text.dart';
// import 'package:pull_to_refresh/pull_to_refresh.dart';
//
// class SmartRefresh extends StatelessWidget {
// const SmartRefresh(
// {this.child,
// this.footer,
// this.onLoading,
// this.onRefresh,
// this.waterDropColor,
// this.idleIconColor,
// this.controller,
// Key? key})
// : super(key: key);
// final Widget? child;
// final bool? footer;
// final Function? onRefresh, onLoading;
// final RefreshController? controller;
// final Color? waterDropColor;
// final Color? idleIconColor;
//
// @override
// Widget build(BuildContext context) {
// return SmartRefresher(
// enablePullDown: true,
// enablePullUp: footer!,
// header: WaterDropHeader(
// waterDropColor: waterDropColor ?? Theme.of(context).primaryColor,
// idleIcon: Icon(
// Icons.autorenew,
// size: 15,
// color: idleIconColor ?? Colors.white,
// ),
// complete: refreshStatue('refresh-complete'.tr(), Icons.done),
// failed: refreshStatue('refresh-failed'.tr(), Icons.close),
// ),
// footer: CustomFooter(
// builder: (BuildContext context, LoadStatus? mode) {
// Widget body;
// if (mode == LoadStatus.idle) {
// body = MyText(title: 'pull-up-load'.tr());
// } else if (mode == LoadStatus.loading) {
// body = const CupertinoActivityIndicator();
// } else if (mode == LoadStatus.failed) {
// body = MyText(title: 'load-failed-click-try'.tr());
// } else if (mode == LoadStatus.canLoading) {
// body = MyText(title: 'release-load-more'.tr());
// } else {
// body = MyText(title: 'no-more-data'.tr());
// }
// return SizedBox(
// height: 55,
// child: Center(child: body),
// );
// },
// ),
// controller: controller!,
// onRefresh: () {
// onRefresh!.call();
// },
// onLoading: () {
// onLoading!.call();
// },
// child: child,
// );
// }
//
// Widget refreshStatue(String refreshStatue, IconData icon) => Row(
// mainAxisAlignment: MainAxisAlignment.center,
// children: <Widget>[
// Icon(icon, color: Colors.grey),
// Container(width: 15),
// MyText(title: refreshStatue, color: Colors.grey)
// ],
// );
// }