Skip to content

Commit 4d4b721

Browse files
committed
fix: add DashboardBloc import and trigger DashboardSummaryLoaded in edit headline, source, and topic pages
1 parent 043bc86 commit 4d4b721

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

lib/content_management/view/edit_headline_page.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
44
import 'package:flutter_bloc/flutter_bloc.dart';
55
import 'package:flutter_news_app_web_dashboard_full_source_code/content_management/bloc/content_management_bloc.dart';
66
import 'package:flutter_news_app_web_dashboard_full_source_code/content_management/bloc/edit_headline/edit_headline_bloc.dart';
7+
import 'package:flutter_news_app_web_dashboard_full_source_code/dashboard/bloc/dashboard_bloc.dart';
78
import 'package:flutter_news_app_web_dashboard_full_source_code/l10n/l10n.dart';
89
import 'package:flutter_news_app_web_dashboard_full_source_code/shared/shared.dart';
910
import 'package:go_router/go_router.dart';
@@ -116,6 +117,7 @@ class _EditHeadlineViewState extends State<_EditHeadlineView> {
116117
context.read<ContentManagementBloc>().add(
117118
const LoadHeadlinesRequested(limit: kDefaultRowsPerPage),
118119
);
120+
context.read<DashboardBloc>().add(DashboardSummaryLoaded());
119121
context.pop();
120122
}
121123
if (state.status == EditHeadlineStatus.failure) {

lib/content_management/view/edit_source_page.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
44
import 'package:flutter_bloc/flutter_bloc.dart';
55
import 'package:flutter_news_app_web_dashboard_full_source_code/content_management/bloc/content_management_bloc.dart';
66
import 'package:flutter_news_app_web_dashboard_full_source_code/content_management/bloc/edit_source/edit_source_bloc.dart';
7+
import 'package:flutter_news_app_web_dashboard_full_source_code/dashboard/bloc/dashboard_bloc.dart';
78
import 'package:flutter_news_app_web_dashboard_full_source_code/l10n/l10n.dart';
89
import 'package:flutter_news_app_web_dashboard_full_source_code/shared/extensions/source_type_l10n.dart';
910
import 'package:flutter_news_app_web_dashboard_full_source_code/shared/shared.dart';
@@ -113,6 +114,7 @@ class _EditSourceViewState extends State<_EditSourceView> {
113114
context.read<ContentManagementBloc>().add(
114115
const LoadSourcesRequested(limit: kDefaultRowsPerPage),
115116
);
117+
context.read<DashboardBloc>().add(DashboardSummaryLoaded());
116118
context.pop();
117119
}
118120
if (state.status == EditSourceStatus.failure) {

lib/content_management/view/edit_topic_page.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
44
import 'package:flutter_bloc/flutter_bloc.dart';
55
import 'package:flutter_news_app_web_dashboard_full_source_code/content_management/bloc/content_management_bloc.dart';
66
import 'package:flutter_news_app_web_dashboard_full_source_code/content_management/bloc/edit_topic/edit_topic_bloc.dart';
7+
import 'package:flutter_news_app_web_dashboard_full_source_code/dashboard/bloc/dashboard_bloc.dart';
78
import 'package:flutter_news_app_web_dashboard_full_source_code/l10n/l10n.dart';
89
import 'package:flutter_news_app_web_dashboard_full_source_code/shared/shared.dart';
910
import 'package:go_router/go_router.dart';
@@ -110,6 +111,7 @@ class _EditTopicViewState extends State<_EditTopicView> {
110111
context.read<ContentManagementBloc>().add(
111112
const LoadTopicsRequested(limit: kDefaultRowsPerPage),
112113
);
114+
context.read<DashboardBloc>().add(DashboardSummaryLoaded());
113115
context.pop();
114116
}
115117
if (state.status == EditTopicStatus.failure) {

0 commit comments

Comments
 (0)