getReleaseBundle method
Gets a ReleaseBundle for the targetVersion
.
Implementation
@override
Future<ReleaseBundle?> getReleaseBundle(String name, Version targetVersion,
[String? platform]) async {
var file = ReleaseBundle.formatReleaseBundleFile(
releasesBundleFileFormat, name, targetVersion, platform);
var body = await _getHttpPath(file);
if (body == null) return null;
var byteArray = body.asByteArray!;
var zipBytes =
byteArray is Uint8List ? byteArray : Uint8List.fromList(byteArray);
var rootPath =
file.replaceFirst(RegExp(r'\.zip$', caseSensitive: false), '');
var release = Release(name, targetVersion, platform: platform);
var releaseBundle =
ReleaseBundleZip(release, zipBytes: zipBytes, rootPath: rootPath);
return releaseBundle;
}