2023-05-06 16:12:18 -04:00
|
|
|
import 'dart:convert';
|
|
|
|
|
|
|
|
import 'package:http/http.dart' as http;
|
|
|
|
|
|
|
|
class GithubApi {
|
|
|
|
static const baseUrl = "https://api.github.com";
|
|
|
|
|
|
|
|
static Future<String> getLatestTagName() async {
|
2023-10-03 13:00:59 -04:00
|
|
|
final response = await http.get(Uri.parse("$baseUrl/repos/Nutcake/ReCon/releases/latest"));
|
2023-05-06 16:12:18 -04:00
|
|
|
if (response.statusCode != 200) return "";
|
|
|
|
final body = jsonDecode(response.body);
|
|
|
|
return body["tag_name"] ?? "";
|
|
|
|
}
|
|
|
|
}
|