Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/dotto/lib/domain/github_profile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ abstract class GitHubProfile with _$GitHubProfile {
required String avatarUrl,
required String htmlUrl,
required int contributions,
required String type,
}) = _GitHubProfile;
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ final class GitHubContributorService {

Future<List<GitHubProfile>> getContributors() async {
final contributors = await gitHubContributorRepository.getContributors();
contributors.sort((a, b) => b.contributions.compareTo(a.contributions));
return contributors;
final filteredContributors = contributors
.where((contributor) => contributor.type == 'User')
.toList();
filteredContributors.sort(
(a, b) => b.contributions.compareTo(a.contributions),
);
return filteredContributors;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ final class GitHubContributorRepositoryImpl
avatarUrl: e.avatarUrl,
htmlUrl: e.htmlUrl,
contributions: e.contributions,
type: e.type ?? 'User',
),
)
.toList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ abstract class GitHubProfileResponse with _$GitHubProfileResponse {
required String avatarUrl,
required String htmlUrl,
required int contributions,
required String? type,
}) = _GitHubProfileResponse;

factory GitHubProfileResponse.fromJson(Map<String, Object?> json) =>
Expand Down
Loading