mod: check future builder data

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2024-12-15 17:06:40 +08:00
parent 4aadc9b050
commit 726fd0b338
6 changed files with 61 additions and 0 deletions

View File

@@ -92,6 +92,16 @@ class _FavPanelState extends State<FavPanel> {
future: _futureBuilderFuture,
builder: (BuildContext context, AsyncSnapshot snapshot) {
if (snapshot.connectionState == ConnectionState.done) {
// TODO: refactor
if (snapshot.data is! Map) {
return HttpError(
isSliver: false,
callback: () => setState(() {
_futureBuilderFuture =
widget.ctr!.queryVideoInFolder();
}),
);
}
Map data = snapshot.data as Map;
if (data['status']) {
return Obx(

View File

@@ -102,6 +102,15 @@ class _GroupPanelState extends State<GroupPanel> {
future: _futureBuilderFuture,
builder: (BuildContext context, AsyncSnapshot snapshot) {
if (snapshot.connectionState == ConnectionState.done) {
// TODO: refactor
if (snapshot.data is! Map) {
return HttpError(
isSliver: false,
callback: () => setState(() {
_futureBuilderFuture = MemberHttp.followUpTags();
}),
);
}
Map data = snapshot.data as Map;
if (data['status']) {
return ListView.builder(