diff --git a/lib/pages/dynamics_detail/view.dart b/lib/pages/dynamics_detail/view.dart index a34d7e7b9..3beba2eda 100644 --- a/lib/pages/dynamics_detail/view.dart +++ b/lib/pages/dynamics_detail/view.dart @@ -72,7 +72,12 @@ class _DynamicDetailPageState // ).whenComplete(_stopRefresh); } - late final AnimationController _refreshController; + AnimationController? refreshController; + AnimationController get _refreshController => + refreshController ??= AnimationController( + vsync: this, + duration: CircularProgressIndicator.defaultAnimationDuration, + ); @override dynamic get arguments => {'item': controller.dynItem}; @@ -96,15 +101,11 @@ class _DynamicDetailPageState ), tag: id, ); - _refreshController = AnimationController( - vsync: this, - duration: CircularProgressIndicator.defaultAnimationDuration, - ); } @override void dispose() { - _refreshController.dispose(); + refreshController?.dispose(); super.dispose(); }