Skip to content
This repository has been archived by the owner on Oct 3, 2024. It is now read-only.

Commit

Permalink
fix the issue that the local favorite top bar was not updated after c…
Browse files Browse the repository at this point in the history
…anceling a favorite item
  • Loading branch information
wgh136 committed Sep 18, 2024
1 parent fb146b1 commit 1e64b21
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lib/pages/favorites/main_favorites_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ import "package:flutter/material.dart";
import "package:flutter_reorderable_grid_view/widgets/reorderable_builder.dart";
import "package:pica_comic/base.dart";
import "package:pica_comic/comic_source/comic_source.dart";
import 'package:pica_comic/components/components.dart';
import "package:pica_comic/foundation/app.dart";
import "package:pica_comic/foundation/local_favorites.dart";
import "package:pica_comic/foundation/log.dart";
import "package:pica_comic/network/download.dart";
import "package:pica_comic/tools/translations.dart";
import 'package:pica_comic/components/components.dart';

import "../../network/net_fav_to_local.dart";
import "../../tools/io_tools.dart";
import "local_favorites.dart";
Expand Down Expand Up @@ -781,7 +782,14 @@ class _ComicsPageViewState extends StateWithController<ComicsPageView> {
key: ValueKey(comic.toString()),
comic,
folder,
rebuild,
() {
rebuild();
if(widget.selectedComics.contains(comic)) {
var c = StateController.find<FavoritesPageController>();
c.selectedComics.remove(comic);
c.update();
}
},
true,
onTap: () => widget.onClick(comic),
onLongPressed: () => widget.onLongPressed(comic),
Expand Down

0 comments on commit 1e64b21

Please sign in to comment.