@@ -32,17 +32,9 @@ class EditSourceBloc extends Bloc<EditSourceEvent, EditSourceState> {
32
32
on < EditSourceHeadquartersChanged > (_onHeadquartersChanged);
33
33
on < EditSourceStatusChanged > (_onStatusChanged);
34
34
on < EditSourceSubmitted > (_onSubmitted);
35
- on < EditSourceCountrySearchChanged > (
36
- _onCountrySearchChanged,
37
- transformer: droppable (),
38
- );
39
35
on < EditSourceLoadMoreCountriesRequested > (
40
36
_onLoadMoreCountriesRequested,
41
37
);
42
- on < EditSourceLanguageSearchChanged > (
43
- _onLanguageSearchChanged,
44
- transformer: droppable (),
45
- );
46
38
on < EditSourceLoadMoreLanguagesRequested > (
47
39
_onLoadMoreLanguagesRequested,
48
40
);
@@ -240,37 +232,6 @@ class EditSourceBloc extends Bloc<EditSourceEvent, EditSourceState> {
240
232
}
241
233
}
242
234
243
- Future <void > _onCountrySearchChanged (
244
- EditSourceCountrySearchChanged event,
245
- Emitter <EditSourceState > emit,
246
- ) async {
247
- await Future <void >.delayed (_searchDebounceDuration);
248
- emit (state.copyWith (countrySearchTerm: event.searchTerm));
249
- try {
250
- final countriesResponse = await _countriesRepository.readAll (
251
- filter: event.searchTerm.isNotEmpty ? {'name' : event.searchTerm} : null ,
252
- sort: [const SortOption ('name' , SortOrder .asc)],
253
- );
254
-
255
- emit (
256
- state.copyWith (
257
- countries: countriesResponse.items,
258
- countriesCursor: countriesResponse.cursor,
259
- countriesHasMore: countriesResponse.hasMore,
260
- ),
261
- );
262
- } on HttpException catch (e) {
263
- emit (state.copyWith (status: EditSourceStatus .failure, exception: e));
264
- } catch (e) {
265
- emit (
266
- state.copyWith (
267
- status: EditSourceStatus .failure,
268
- exception: UnknownException ('An unexpected error occurred: $e ' ),
269
- ),
270
- );
271
- }
272
- }
273
-
274
235
Future <void > _onLoadMoreCountriesRequested (
275
236
EditSourceLoadMoreCountriesRequested event,
276
237
Emitter <EditSourceState > emit,
@@ -284,9 +245,6 @@ class EditSourceBloc extends Bloc<EditSourceEvent, EditSourceState> {
284
245
pagination: state.countriesCursor != null
285
246
? PaginationOptions (cursor: state.countriesCursor)
286
247
: null ,
287
- filter: state.countrySearchTerm.isNotEmpty
288
- ? {'name' : state.countrySearchTerm}
289
- : null ,
290
248
sort: [const SortOption ('name' , SortOrder .asc)],
291
249
);
292
250
@@ -317,37 +275,6 @@ class EditSourceBloc extends Bloc<EditSourceEvent, EditSourceState> {
317
275
}
318
276
}
319
277
320
- Future <void > _onLanguageSearchChanged (
321
- EditSourceLanguageSearchChanged event,
322
- Emitter <EditSourceState > emit,
323
- ) async {
324
- await Future <void >.delayed (_searchDebounceDuration);
325
- emit (state.copyWith (languageSearchTerm: event.searchTerm));
326
- try {
327
- final languagesResponse = await _languagesRepository.readAll (
328
- filter: event.searchTerm.isNotEmpty ? {'name' : event.searchTerm} : null ,
329
- sort: [const SortOption ('name' , SortOrder .asc)],
330
- );
331
-
332
- emit (
333
- state.copyWith (
334
- languages: languagesResponse.items,
335
- languagesCursor: languagesResponse.cursor,
336
- languagesHasMore: languagesResponse.hasMore,
337
- ),
338
- );
339
- } on HttpException catch (e) {
340
- emit (state.copyWith (status: EditSourceStatus .failure, exception: e));
341
- } catch (e) {
342
- emit (
343
- state.copyWith (
344
- status: EditSourceStatus .failure,
345
- exception: UnknownException ('An unexpected error occurred: $e ' ),
346
- ),
347
- );
348
- }
349
- }
350
-
351
278
Future <void > _onLoadMoreLanguagesRequested (
352
279
EditSourceLoadMoreLanguagesRequested event,
353
280
Emitter <EditSourceState > emit,
@@ -361,9 +288,6 @@ class EditSourceBloc extends Bloc<EditSourceEvent, EditSourceState> {
361
288
pagination: state.languagesCursor != null
362
289
? PaginationOptions (cursor: state.languagesCursor)
363
290
: null ,
364
- filter: state.languageSearchTerm.isNotEmpty
365
- ? {'name' : state.languageSearchTerm}
366
- : null ,
367
291
sort: [const SortOption ('name' , SortOrder .asc)],
368
292
);
369
293
0 commit comments