You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1022 B
40 lines
1022 B
4 years ago
|
import 'package:ansu_ui/styles/as_colors.dart';
|
||
|
import 'package:flutter/material.dart';
|
||
|
import 'package:flutter_easyrefresh/easy_refresh.dart';
|
||
|
|
||
|
class ASRefresh extends StatefulWidget {
|
||
|
final Widget child;
|
||
|
final Future Function() onLoad;
|
||
|
final Future Function() onRefresh;
|
||
|
final EasyRefreshController controller;
|
||
|
ASRefresh({
|
||
|
Key key,
|
||
|
@required this.child,
|
||
|
this.onLoad,
|
||
|
this.onRefresh,
|
||
|
this.controller,
|
||
|
}) : super(key: key);
|
||
|
|
||
|
@override
|
||
|
_ASRefreshState createState() => _ASRefreshState();
|
||
|
}
|
||
|
|
||
|
class _ASRefreshState extends State<ASRefresh> {
|
||
|
@override
|
||
|
Widget build(BuildContext context) {
|
||
|
return EasyRefresh(
|
||
|
child: widget.child,
|
||
|
onRefresh: widget.onRefresh,
|
||
|
onLoad: widget.onLoad,
|
||
|
controller: widget.controller,
|
||
|
header: MaterialHeader(
|
||
|
valueColor: AlwaysStoppedAnimation(kPrimaryColor),
|
||
|
),
|
||
|
footer: MaterialFooter(
|
||
|
enableInfiniteLoad: false,
|
||
|
valueColor: AlwaysStoppedAnimation(kPrimaryColor),
|
||
|
),
|
||
|
);
|
||
|
}
|
||
|
}
|