feat:更新好友菜谱功能

This commit is contained in:
2026-06-28 19:54:32 +08:00
parent a340ba424e
commit c10e8e5ffb
13 changed files with 67 additions and 29 deletions

View File

@@ -116,6 +116,26 @@ class FoodProvider with ChangeNotifier {
}
}
Future<void> queryRecipeByUserId(int userId) async {
if (isLoading) return;
try {
isLoading = true;
error = null;
notifyListeners();
final result = await queryRecipeByUserApi(userId);
recipeSummaryList = result;
notifyListeners();
} catch (e) {
error = '加载数据失败: $e';
debugPrint('加载数据失败: $e');
} finally {
isLoading = false;
notifyListeners();
}
}
Future<void> refreshRecipeList() async {
if (isLoading) return;