toggleFavorite method

Future<bool> toggleFavorite(
  1. String storyId,
  2. bool isFavorite
)

收藏故事 storyId 故事ID isFavorite 是否收藏

Implementation

Future<bool> toggleFavorite(String storyId, bool isFavorite) async {
  try {
    return await PangrowthContent.favoriteStory(
      storyId,
      isFavorite: isFavorite,
    );
  } catch (e) {
    debugPrint('收藏操作失败: $e');
    return false;
  }
}