taafee-mobile/lib/features/home/data_layer/model/search.dart
2023-10-17 17:22:55 +03:00

22 lines
549 B
Dart

class SearchModel {
int? categoryId;
int? cityId;
int? page;
String? searchWords;
String? cityName;
String? categoryName;
SearchModel({this.categoryId, this.cityId, this.searchWords, this.page});
factory SearchModel.zero() => SearchModel();
Map<String, dynamic> toJson() {
Map<String, dynamic> data = {
if (page != null) 'page': page,
if (searchWords != null) 'name': searchWords,
if (categoryId != null) 'category_id': categoryId,
if (cityId != null) 'city_id': cityId,
};
return data;
}
}