Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions modules/ensemble/lib/framework/action.dart
Original file line number Diff line number Diff line change
Expand Up @@ -168,14 +168,19 @@ class NavigateViewGroupAction extends EnsembleAction {
ScreenController()
.navigateToScreen(context, screenName: screenName, pageArgs: payload);
} else if (viewIndex != null) {
final pageGroup = context.findAncestorWidgetOfExactType<PageGroup>();
final menuLen = pageGroup?.menu.menuItems.length ?? 0;
final resolvedIndex = menuLen > 0
? safeViewGroupPayloadIndex(viewIndex, menuLen)
: viewIndex;
if (payload != null) {
// TODO: this is wrong. Can't mutate the scope like this
scopeManager.dataContext.addDataContext(payload);
}
// TODO: refactor the below. Both are needed when reloadView=false, but only
// viewGroupNotifier is needed without. Doesn't make any sense
PageGroupWidget.getPageController(context)?.jumpToPage(viewIndex);
viewGroupNotifier.updatePage(viewIndex, payload: payload);
PageGroupWidget.getPageController(context)?.jumpToPage(resolvedIndex);
viewGroupNotifier.updatePage(resolvedIndex, payload: payload);
}
return Future.value(null);
}
Expand Down