@@ -32,17 +32,9 @@ class EditSourceBloc extends Bloc<EditSourceEvent, EditSourceState> {
3232 on < EditSourceHeadquartersChanged > (_onHeadquartersChanged);
3333 on < EditSourceStatusChanged > (_onStatusChanged);
3434 on < EditSourceSubmitted > (_onSubmitted);
35- on < EditSourceCountrySearchChanged > (
36- _onCountrySearchChanged,
37- transformer: droppable (),
38- );
3935 on < EditSourceLoadMoreCountriesRequested > (
4036 _onLoadMoreCountriesRequested,
4137 );
42- on < EditSourceLanguageSearchChanged > (
43- _onLanguageSearchChanged,
44- transformer: droppable (),
45- );
4638 on < EditSourceLoadMoreLanguagesRequested > (
4739 _onLoadMoreLanguagesRequested,
4840 );
@@ -240,37 +232,6 @@ class EditSourceBloc extends Bloc<EditSourceEvent, EditSourceState> {
240232 }
241233 }
242234
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-
274235 Future <void > _onLoadMoreCountriesRequested (
275236 EditSourceLoadMoreCountriesRequested event,
276237 Emitter <EditSourceState > emit,
@@ -284,9 +245,6 @@ class EditSourceBloc extends Bloc<EditSourceEvent, EditSourceState> {
284245 pagination: state.countriesCursor != null
285246 ? PaginationOptions (cursor: state.countriesCursor)
286247 : null ,
287- filter: state.countrySearchTerm.isNotEmpty
288- ? {'name' : state.countrySearchTerm}
289- : null ,
290248 sort: [const SortOption ('name' , SortOrder .asc)],
291249 );
292250
@@ -317,37 +275,6 @@ class EditSourceBloc extends Bloc<EditSourceEvent, EditSourceState> {
317275 }
318276 }
319277
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-
351278 Future <void > _onLoadMoreLanguagesRequested (
352279 EditSourceLoadMoreLanguagesRequested event,
353280 Emitter <EditSourceState > emit,
@@ -361,9 +288,6 @@ class EditSourceBloc extends Bloc<EditSourceEvent, EditSourceState> {
361288 pagination: state.languagesCursor != null
362289 ? PaginationOptions (cursor: state.languagesCursor)
363290 : null ,
364- filter: state.languageSearchTerm.isNotEmpty
365- ? {'name' : state.languageSearchTerm}
366- : null ,
367291 sort: [const SortOption ('name' , SortOrder .asc)],
368292 );
369293
0 commit comments