2023-05-06 16:12:18 -04:00
|
|
|
import 'dart:convert';
|
|
|
|
|
|
|
|
import 'package:http/http.dart' as http;
|
|
|
|
|
|
|
|
class GithubApi {
|
2024-07-15 11:18:48 -04:00
|
|
|
static const baseUrl = "https://git.mrdab.vore.media/api/v1";
|
2023-05-06 16:12:18 -04:00
|
|
|
|
|
|
|
static Future<String> getLatestTagName() async {
|
2024-07-15 11:18:48 -04:00
|
|
|
final response = await http.get(Uri.parse("$baseUrl/repos/ThatOneJackalGuy/OpenContacts/releases?per_page=1"));
|
2023-05-06 16:12:18 -04:00
|
|
|
if (response.statusCode != 200) return "";
|
2023-10-12 13:17:53 -04:00
|
|
|
final body = jsonDecode(response.body) as List;
|
|
|
|
if (body.isEmpty) return "";
|
|
|
|
return body.first["tag_name"] ?? "";
|
2023-05-06 16:12:18 -04:00
|
|
|
}
|
|
|
|
}
|