feat: fetch real data on the Latest Commit card

This commit is contained in:
Alberto Ponces
2022-08-07 23:40:31 +01:00
parent 3df427dccb
commit a430537b6f
4 changed files with 39 additions and 27 deletions

View File

@ -1,5 +1,6 @@
import 'package:github/github.dart';
import 'package:injectable/injectable.dart';
import 'package:timeago/timeago.dart';
@lazySingleton
class GithubAPI {
@ -19,10 +20,10 @@ class GithubAPI {
return dlurl;
}
Future<DateTime?> latestCommitTime(String org, repoName) async {
Future<String> latestCommitTime(String org, repoName) async {
var repo = await github.repositories.getRepository(
RepositorySlug(org, repoName),
);
return repo.pushedAt;
return format(repo.pushedAt!);
}
}