syncFromWidget method
void
syncFromWidget({})
Implementation
void syncFromWidget({
required List<FxPane> dockPanes,
List<FxPane> drawerPanes = const [],
List<FxPane> endDrawerPanes = const [],
required String initialPaneKey,
}) {
final merged = FxPane.mergeRegistry(
dockPanes: dockPanes,
drawerPanes: drawerPanes,
endDrawerPanes: endDrawerPanes,
);
if (merged.isEmpty) {
state = const FxShellState();
return;
}
final registry = merged.values.toList();
final initial = merged[state.currentPaneKey ?? initialPaneKey] ?? registry.first;
state = FxShellState(
dockPanes: List<FxPane>.unmodifiable(dockPanes),
drawerPanes: List<FxPane>.unmodifiable(drawerPanes),
endDrawerPanes: List<FxPane>.unmodifiable(endDrawerPanes),
registry: List<FxPane>.unmodifiable(registry),
currentPane: initial,
history: [initial.key],
);
}