feat:更新好友菜谱功能
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user