From 5cfe4a6ad963fbeffc94b394878fca80411f8d6f Mon Sep 17 00:00:00 2001 From: allllen4a Date: Thu, 19 Sep 2024 15:13:14 +0300 Subject: [PATCH] lab2 --- lib/main.dart | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 5f06a4b..441d2ef 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -35,7 +35,7 @@ class RecipeManager { List _recipes = []; Future addRecipe(T recipe) async { - await Future.delayed(Duration(seconds: 1)); // Имитация асинхронной операции + await Future.delayed(Duration(seconds: 1)); _recipes.add(recipe); } @@ -45,7 +45,7 @@ class RecipeManager { if (index < _recipes.length) { return _recipes[index]; } - return null; // Вернём null, если индекс вне диапазона + return null; } } @@ -78,7 +78,7 @@ class _RecipeHomeState extends State { _nameController.clear(); _ingredientsController.clear(); _selectedCuisine = null; - setState(() {}); // Обновляем интерфейс + setState(() {}); }); } } @@ -137,4 +137,5 @@ class _RecipeHomeState extends State { ), ); } + } \ No newline at end of file