feat: use github to get latest patches version if custom sources are used.

This commit is contained in:
Aunali321 2022-11-23 10:03:56 +05:30
parent 6e05120aa5
commit b0c4567cb8
2 changed files with 28 additions and 3 deletions

View file

@ -130,4 +130,18 @@ class GithubAPI {
}
return patches;
}
Future<String> getLastestReleaseVersion(String repoName) async {
try {
Map<String, dynamic>? release = await _getLatestRelease(repoName);
if (release != null) {
return release['tag_name'];
} else {
return 'Unknown';
}
} on Exception catch (e, s) {
await Sentry.captureException(e, stackTrace: s);
return '';
}
}
}