@@ -7,6 +7,7 @@ import 'package:gsy_github_app_flutter/common/utils/common_utils.dart';
77import 'dart:math' ;
88
99import 'custom_bouncing_scroll_physics.dart' ;
10+ import 'gsy_flare_pull_controller.dart' ;
1011
1112const double iosRefreshHeight = 140 ;
1213const double iosRefreshIndicatorExtent = 100 ;
@@ -40,13 +41,17 @@ class GSYPullLoadWidget extends StatefulWidget {
4041 _GSYPullLoadWidgetState createState () => _GSYPullLoadWidgetState ();
4142}
4243
43- class _GSYPullLoadWidgetState extends State <GSYPullLoadWidget > {
44+ class _GSYPullLoadWidgetState extends State <GSYPullLoadWidget >
45+ with GSYFlarePullController {
4446 ScrollController _scrollController;
4547
4648 bool isRefreshing = false ;
4749
4850 bool isLoadMoring = false ;
4951
52+ @override
53+ ValueNotifier <bool > isActive = ValueNotifier <bool >(true );
54+
5055 @override
5156 void initState () {
5257 _scrollController = widget.scrollController ?? new ScrollController ();
@@ -288,13 +293,20 @@ class _GSYPullLoadWidgetState extends State<GSYPullLoadWidget> {
288293 );
289294 }
290295
296+ bool playAuto = false ;
297+
298+ @override
299+ bool get getPlayAuto => playAuto;
300+
291301 Widget buildSimpleRefreshIndicator (
292302 BuildContext context,
293303 IOS .RefreshIndicatorMode refreshState,
294304 double pulledExtent,
295305 double refreshTriggerPullDistance,
296306 double refreshIndicatorExtent,
297307 ) {
308+ pulledExtentFlare = pulledExtent * 0.6 ;
309+ playAuto = refreshState == IOS .RefreshIndicatorMode .refresh;
298310 return Align (
299311 alignment: Alignment .bottomCenter,
300312 child: new Container (
@@ -307,6 +319,7 @@ class _GSYPullLoadWidgetState extends State<GSYPullLoadWidget> {
307319 child: FlareActor ("static/file/loading_world_now.flr" ,
308320 alignment: Alignment .topCenter,
309321 fit: BoxFit .cover,
322+ controller: this ,
310323 animation: "Earth Moving" ),
311324 ),
312325 );
0 commit comments