feat(category): add autocomplete for subcategories
This commit is contained in:
@@ -78,6 +78,21 @@ final categoriesProvider = StreamProvider<List<String>>((ref) {
|
||||
});
|
||||
});
|
||||
|
||||
/// 세부 카테고리 목록 Provider
|
||||
final subCategoriesProvider = StreamProvider<List<String>>((ref) {
|
||||
final restaurantsStream = ref.watch(restaurantListProvider.stream);
|
||||
return restaurantsStream.map((restaurants) {
|
||||
final subCategories =
|
||||
restaurants
|
||||
.map((r) => r.subCategory)
|
||||
.where((s) => s.isNotEmpty)
|
||||
.toSet()
|
||||
.toList()
|
||||
..sort();
|
||||
return subCategories;
|
||||
});
|
||||
});
|
||||
|
||||
/// 맛집 관리 StateNotifier
|
||||
class RestaurantNotifier extends StateNotifier<AsyncValue<void>> {
|
||||
final RestaurantRepository _repository;
|
||||
|
||||
Reference in New Issue
Block a user