syncFromWidget method
void
syncFromWidget({
- required List<
VoDashboardPane> dockPanes, - List<
VoDashboardPane> drawerPanes = const [], - List<
VoDashboardPane> endDrawerPanes = const [], - required String initialPaneKey,
- bool forceInitialPane = false,
Implementation
void syncFromWidget({
required List<VoDashboardPane> dockPanes,
List<VoDashboardPane> drawerPanes = const [],
List<VoDashboardPane> endDrawerPanes = const [],
required String initialPaneKey,
bool forceInitialPane = false,
}) {
final merged = VoDashboardPane.mergeRegistry(
dockPanes: dockPanes,
drawerPanes: drawerPanes,
endDrawerPanes: endDrawerPanes,
);
if (merged.isEmpty) {
_disposePageFlow();
state = const VoDashboardState();
return;
}
final registry = merged.values.toList();
final flowPages = _pagesFromRegistry(registry);
final activeKey = _resolveActiveKey(
merged: merged,
initialPaneKey: initialPaneKey,
forceInitialPane: forceInitialPane,
);
if (forceInitialPane || !state.isInitialized) {
_resetPageFlow(activeKey, flowPages);
} else {
_ensurePageFlow(initialPaneKey);
_pageFlow!.attach(flowPages);
if (state.paneByKey(_pageFlow!.currentKey) == null) {
_pageFlow!.replace(activeKey);
}
}
state = VoDashboardState(
dockPanes: List<VoDashboardPane>.unmodifiable(dockPanes),
drawerPanes: List<VoDashboardPane>.unmodifiable(drawerPanes),
endDrawerPanes: List<VoDashboardPane>.unmodifiable(endDrawerPanes),
registry: List<VoDashboardPane>.unmodifiable(registry),
flowPages: List<VoPage>.unmodifiable(flowPages),
isInitialized: true,
);
_syncCurrentPaneFromPageFlow();
}