fix: favPanel reBuild

This commit is contained in:
guozhigq
2023-07-25 20:23:23 +08:00
parent 9f7b631a41
commit 235d1809d7

View File

@ -15,11 +15,13 @@ class FavPanel extends StatefulWidget {
class _FavPanelState extends State<FavPanel> { class _FavPanelState extends State<FavPanel> {
Box localCache = GStrorage.localCache; Box localCache = GStrorage.localCache;
late double sheetHeight; late double sheetHeight;
late Future _futureBuilderFuture;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
sheetHeight = localCache.get('sheetHeight'); sheetHeight = localCache.get('sheetHeight');
_futureBuilderFuture = widget.ctr!.queryVideoInFolder();
} }
@override @override
@ -52,7 +54,7 @@ class _FavPanelState extends State<FavPanel> {
Expanded( Expanded(
child: Material( child: Material(
child: FutureBuilder( child: FutureBuilder(
future: widget.ctr!.queryVideoInFolder(), future: _futureBuilderFuture,
builder: (context, snapshot) { builder: (context, snapshot) {
if (snapshot.connectionState == ConnectionState.done) { if (snapshot.connectionState == ConnectionState.done) {
Map data = snapshot.data as Map; Map data = snapshot.data as Map;