@@ -31,17 +31,9 @@ class CreateSourceBloc extends Bloc<CreateSourceEvent, CreateSourceState> {
31
31
on < CreateSourceHeadquartersChanged > (_onHeadquartersChanged);
32
32
on < CreateSourceStatusChanged > (_onStatusChanged);
33
33
on < CreateSourceSubmitted > (_onSubmitted);
34
- on < CreateSourceCountrySearchChanged > (
35
- _onCountrySearchChanged,
36
- transformer: droppable (),
37
- );
38
34
on < CreateSourceLoadMoreCountriesRequested > (
39
35
_onLoadMoreCountriesRequested,
40
36
);
41
- on < CreateSourceLanguageSearchChanged > (
42
- _onLanguageSearchChanged,
43
- transformer: droppable (),
44
- );
45
37
on < CreateSourceLoadMoreLanguagesRequested > (
46
38
_onLoadMoreLanguagesRequested,
47
39
);
@@ -186,37 +178,6 @@ class CreateSourceBloc extends Bloc<CreateSourceEvent, CreateSourceState> {
186
178
}
187
179
}
188
180
189
- Future <void > _onCountrySearchChanged (
190
- CreateSourceCountrySearchChanged event,
191
- Emitter <CreateSourceState > emit,
192
- ) async {
193
- await Future <void >.delayed (_searchDebounceDuration);
194
- emit (state.copyWith (countrySearchTerm: event.searchTerm));
195
- try {
196
- final countriesResponse = await _countriesRepository.readAll (
197
- filter: event.searchTerm.isNotEmpty ? {'name' : event.searchTerm} : null ,
198
- sort: [const SortOption ('name' , SortOrder .asc)],
199
- );
200
-
201
- emit (
202
- state.copyWith (
203
- countries: countriesResponse.items,
204
- countriesCursor: countriesResponse.cursor,
205
- countriesHasMore: countriesResponse.hasMore,
206
- ),
207
- );
208
- } on HttpException catch (e) {
209
- emit (state.copyWith (status: CreateSourceStatus .failure, exception: e));
210
- } catch (e) {
211
- emit (
212
- state.copyWith (
213
- status: CreateSourceStatus .failure,
214
- exception: UnknownException ('An unexpected error occurred: $e ' ),
215
- ),
216
- );
217
- }
218
- }
219
-
220
181
Future <void > _onLoadMoreCountriesRequested (
221
182
CreateSourceLoadMoreCountriesRequested event,
222
183
Emitter <CreateSourceState > emit,
@@ -230,9 +191,6 @@ class CreateSourceBloc extends Bloc<CreateSourceEvent, CreateSourceState> {
230
191
pagination: state.countriesCursor != null
231
192
? PaginationOptions (cursor: state.countriesCursor)
232
193
: null ,
233
- filter: state.countrySearchTerm.isNotEmpty
234
- ? {'name' : state.countrySearchTerm}
235
- : null ,
236
194
sort: [const SortOption ('name' , SortOrder .asc)],
237
195
);
238
196
@@ -263,37 +221,6 @@ class CreateSourceBloc extends Bloc<CreateSourceEvent, CreateSourceState> {
263
221
}
264
222
}
265
223
266
- Future <void > _onLanguageSearchChanged (
267
- CreateSourceLanguageSearchChanged event,
268
- Emitter <CreateSourceState > emit,
269
- ) async {
270
- await Future <void >.delayed (_searchDebounceDuration);
271
- emit (state.copyWith (languageSearchTerm: event.searchTerm));
272
- try {
273
- final languagesResponse = await _languagesRepository.readAll (
274
- filter: event.searchTerm.isNotEmpty ? {'name' : event.searchTerm} : null ,
275
- sort: [const SortOption ('name' , SortOrder .asc)],
276
- );
277
-
278
- emit (
279
- state.copyWith (
280
- languages: languagesResponse.items,
281
- languagesCursor: languagesResponse.cursor,
282
- languagesHasMore: languagesResponse.hasMore,
283
- ),
284
- );
285
- } on HttpException catch (e) {
286
- emit (state.copyWith (status: CreateSourceStatus .failure, exception: e));
287
- } catch (e) {
288
- emit (
289
- state.copyWith (
290
- status: CreateSourceStatus .failure,
291
- exception: UnknownException ('An unexpected error occurred: $e ' ),
292
- ),
293
- );
294
- }
295
- }
296
-
297
224
Future <void > _onLoadMoreLanguagesRequested (
298
225
CreateSourceLoadMoreLanguagesRequested event,
299
226
Emitter <CreateSourceState > emit,
@@ -307,9 +234,6 @@ class CreateSourceBloc extends Bloc<CreateSourceEvent, CreateSourceState> {
307
234
pagination: state.languagesCursor != null
308
235
? PaginationOptions (cursor: state.languagesCursor)
309
236
: null ,
310
- filter: state.languageSearchTerm.isNotEmpty
311
- ? {'name' : state.languageSearchTerm}
312
- : null ,
313
237
sort: [const SortOption ('name' , SortOrder .asc)],
314
238
);
315
239
0 commit comments