getBundle method
Implementation
Future<int> getBundle({
required bool preRelease,
required int transVersion,
required String appVersion,
}) async {
try {
final bundle = await _remoteRepository.getBundle(
getRemoteBundleDto: GetRemoteBundleDto(
credentials: _credentials,
appVersion: appVersion,
translationVersion: transVersion,
preRelease: preRelease,
),
);
if (bundle == null || bundle.translationVersion == transVersion) {
return transVersion;
}
await SdkStore.instance.save(bundle);
SdkOtaData.releaseData = ReleaseData(
version: bundle.translationVersion,
// ignore: deprecated_member_use_from_same_package
data: bundle.legacyTranslations,
);
return bundle.translationVersion;
} on BundleNotFoundException {
SdkStore.instance.removeData();
return 0;
}
}