getData method
Implementation
void getData({
T Function()? onNull,
T Function(PaneInstanceData?)? onWrongDataType,
}) {
final givenData = (widget
.api.workspace.workspaceConfigs.instancesData[widget.instanceId] ??
onNull?.call());
if (givenData is T) {
data = givenData;
} else {
data = onWrongDataType?.call(givenData) ??
(throw Exception(
"Data of type '$T' expected, but '${givenData.runtimeType}' was found in workspace configuration."));
}
}