File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import 'package:food_recipe/src/models/filtercategories/filter_categories.dart';
6
6
import 'package:food_recipe/src/models/latest/latest_meals.dart' ;
7
7
import 'package:food_recipe/src/models/lookupmealsbyid/lookup_meals_by_id.dart' ;
8
8
import 'package:food_recipe/src/models/randommeals/random_meals.dart' ;
9
+ import 'package:food_recipe/src/models/searchmeals/search_meals.dart' ;
9
10
10
11
class FoodApiProvider {
11
12
Dio dio = Dio ();
@@ -74,4 +75,13 @@ class FoodApiProvider {
74
75
}
75
76
}
76
77
78
+ Future <SearchMeals > getSearchMealsByKeyword (String keyword) async {
79
+ final response = await dio.get ("$_baseUrl /api/json/v1/1/search.php?s=$keyword " );
80
+ if (response.statusCode == 200 ) {
81
+ return SearchMeals .fromJson (response.data);
82
+ } else {
83
+ throw Exception ("Failed to get search meals by id keyword" );
84
+ }
85
+ }
86
+
77
87
}
You can’t perform that action at this time.
F83
0 commit comments