@@ -93,7 +93,10 @@ class ContentManagementBloc
9393 }
9494 }
9595
96- void _onHeadlineAdded (HeadlineAdded event, Emitter <ContentManagementState > emit) {
96+ void _onHeadlineAdded (
97+ HeadlineAdded event,
98+ Emitter <ContentManagementState > emit,
99+ ) {
97100 final updatedHeadlines = [event.headline, ...state.headlines];
98101 emit (
99102 state.copyWith (
@@ -121,8 +124,9 @@ class ContentManagementBloc
121124 ) async {
122125 try {
123126 await _headlinesRepository.delete (id: event.id);
124- final updatedHeadlines =
125- state.headlines.where ((h) => h.id != event.id).toList ();
127+ final updatedHeadlines = state.headlines
128+ .where ((h) => h.id != event.id)
129+ .toList ();
126130 emit (state.copyWith (headlines: updatedHeadlines));
127131 } on HtHttpException catch (e) {
128132 emit (
@@ -197,7 +201,9 @@ class ContentManagementBloc
197201 Emitter <ContentManagementState > emit,
198202 ) {
199203 final updatedCategories = List <Category >.from (state.categories);
200- final index = updatedCategories.indexWhere ((c) => c.id == event.category.id);
204+ final index = updatedCategories.indexWhere (
205+ (c) => c.id == event.category.id,
206+ );
201207 if (index != - 1 ) {
202208 updatedCategories[index] = event.category;
203209 emit (state.copyWith (categories: updatedCategories));
@@ -210,8 +216,9 @@ class ContentManagementBloc
210216 ) async {
211217 try {
212218 await _categoriesRepository.delete (id: event.id);
213- final updatedCategories =
214- state.categories.where ((c) => c.id != event.id).toList ();
219+ final updatedCategories = state.categories
220+ .where ((c) => c.id != event.id)
221+ .toList ();
215222 emit (state.copyWith (categories: updatedCategories));
216223 } on HtHttpException catch (e) {
217224 emit (
@@ -296,8 +303,9 @@ class ContentManagementBloc
296303 ) async {
297304 try {
298305 await _sourcesRepository.delete (id: event.id);
299- final updatedSources =
300- state.sources.where ((s) => s.id != event.id).toList ();
306+ final updatedSources = state.sources
307+ .where ((s) => s.id != event.id)
308+ .toList ();
301309 emit (state.copyWith (sources: updatedSources));
302310 } on HtHttpException catch (e) {
303311 emit (
0 commit comments