lazy init dyn refreshctrl

Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-06-28 12:15:22 +08:00
parent aac4524e81
commit add6dfc389

View File

@@ -72,7 +72,12 @@ class _DynamicDetailPageState
// ).whenComplete(_stopRefresh); // ).whenComplete(_stopRefresh);
} }
late final AnimationController _refreshController; AnimationController? refreshController;
AnimationController get _refreshController =>
refreshController ??= AnimationController(
vsync: this,
duration: CircularProgressIndicator.defaultAnimationDuration,
);
@override @override
dynamic get arguments => {'item': controller.dynItem}; dynamic get arguments => {'item': controller.dynItem};
@@ -96,15 +101,11 @@ class _DynamicDetailPageState
), ),
tag: id, tag: id,
); );
_refreshController = AnimationController(
vsync: this,
duration: CircularProgressIndicator.defaultAnimationDuration,
);
} }
@override @override
void dispose() { void dispose() {
_refreshController.dispose(); refreshController?.dispose();
super.dispose(); super.dispose();
} }