From 9863000f4ab7b9b33b8f0be9ccc165260a476b8c Mon Sep 17 00:00:00 2001 From: "Lucas.Xu" Date: Sun, 13 Aug 2023 17:32:52 +0800 Subject: [PATCH] feat: support DidUpdateChildViews callback --- .../lib/workspace/application/view/view_bloc.dart | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/frontend/appflowy_flutter/lib/workspace/application/view/view_bloc.dart b/frontend/appflowy_flutter/lib/workspace/application/view/view_bloc.dart index 1063566ab0..ac8387346c 100644 --- a/frontend/appflowy_flutter/lib/workspace/application/view/view_bloc.dart +++ b/frontend/appflowy_flutter/lib/workspace/application/view/view_bloc.dart @@ -30,6 +30,15 @@ class ViewBloc extends Bloc { onViewUpdated: (result) { add(ViewEvent.viewDidUpdate(left(result))); }, + onViewChildViewsUpdated: (result) async { + final view = await ViewBackendService.getView( + result.parentViewId, + ); + view.fold( + (view) => add(ViewEvent.viewDidUpdate(left(view))), + (error) => add(ViewEvent.viewDidUpdate(right(error))), + ); + }, ); final isExpanded = await _getViewIsExpanded(view); await _loadViewsWhenExpanded(emit, isExpanded);