switchVersion method
- required String versionName,
Switches all connected feature tables to the new version.
An error is thrown if:
- The service isn't branch versioned
- No version exists with the supplied name
- Any of the ServiceGeodatabase.connectedTables have unapplied edits
Check the result of ServiceGeodatabase.hasLocalEdits before attempting to switch versions, to make sure all changes are saved to the service or discarded from the local cache. Use the ServiceGeodatabase.applyEdits or ServiceGeodatabase.undoLocalEdits methods as appropriate to save or discard changes before switching versions.
Parameters:
versionName
— The name of the version to connect to.
Return Value: A Future that has no value.
Implementation
Future<void> switchVersion({
required String versionName,
}) {
final coreVersionName = _CString(versionName);
final taskHandle = _withThrowingErrorHandler((errorHandler) {
return runtimecore.RT_ServiceGeodatabase_switchVersionAsync(
_handle,
coreVersionName.bytes,
errorHandler,
);
});
return taskHandle.toFuture(
(_) {},
);
}