Skip to content

Commit 043bc86

Browse files
committed
fix: add DashboardBloc import and trigger DashboardSummaryLoaded on headline, source, and topic creation
1 parent 0fb49eb commit 043bc86

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

lib/content_management/view/create_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/create_headline/create_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';
@@ -88,6 +89,7 @@ class _CreateHeadlineViewState extends State<_CreateHeadlineView> {
8889
// Refresh the list to show the new headline
8990
const LoadHeadlinesRequested(limit: kDefaultRowsPerPage),
9091
);
92+
context.read<DashboardBloc>().add(DashboardSummaryLoaded());
9193
context.pop();
9294
}
9395
if (state.status == CreateHeadlineStatus.failure) {

lib/content_management/view/create_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/create_source/create_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';
@@ -88,6 +89,7 @@ class _CreateSourceViewState extends State<_CreateSourceView> {
8889
// Refresh the list to show the new source
8990
const LoadSourcesRequested(limit: kDefaultRowsPerPage),
9091
);
92+
context.read<DashboardBloc>().add(DashboardSummaryLoaded());
9193
context.pop();
9294
}
9395
if (state.status == CreateSourceStatus.failure) {

lib/content_management/view/create_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/create_topic/create_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';
@@ -85,6 +86,7 @@ class _CreateTopicViewState extends State<_CreateTopicView> {
8586
// Refresh the list to show the new topic
8687
const LoadTopicsRequested(limit: kDefaultRowsPerPage),
8788
);
89+
context.read<DashboardBloc>().add(DashboardSummaryLoaded());
8890
context.pop();
8991
}
9092
if (state.status == CreateTopicStatus.failure) {

0 commit comments

Comments
 (0)