From 235d1809d7e854131f05a51618b9410ce2a6d65d Mon Sep 17 00:00:00 2001 From: guozhigq Date: Tue, 25 Jul 2023 20:23:23 +0800 Subject: [PATCH] fix: favPanel reBuild --- lib/pages/video/detail/introduction/widgets/fav_panel.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/pages/video/detail/introduction/widgets/fav_panel.dart b/lib/pages/video/detail/introduction/widgets/fav_panel.dart index 5c3454b72..18928f482 100644 --- a/lib/pages/video/detail/introduction/widgets/fav_panel.dart +++ b/lib/pages/video/detail/introduction/widgets/fav_panel.dart @@ -15,11 +15,13 @@ class FavPanel extends StatefulWidget { class _FavPanelState extends State { Box localCache = GStrorage.localCache; late double sheetHeight; + late Future _futureBuilderFuture; @override void initState() { super.initState(); sheetHeight = localCache.get('sheetHeight'); + _futureBuilderFuture = widget.ctr!.queryVideoInFolder(); } @override @@ -52,7 +54,7 @@ class _FavPanelState extends State { Expanded( child: Material( child: FutureBuilder( - future: widget.ctr!.queryVideoInFolder(), + future: _futureBuilderFuture, builder: (context, snapshot) { if (snapshot.connectionState == ConnectionState.done) { Map data = snapshot.data as Map;