mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
feat: support DidUpdateChildViews callback
This commit is contained in:
parent
d0a343ee36
commit
9863000f4a
@ -30,6 +30,15 @@ class ViewBloc extends Bloc<ViewEvent, ViewState> {
|
||||
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);
|
||||
|
Loading…
Reference in New Issue
Block a user