[GH-ISSUE #53] Contributor Screen #1572

Closed
opened 2026-04-21 22:50:50 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @shreyas1599 on GitHub (Apr 10, 2020).
Original GitHub issue: https://github.com/pd4d10/git-touch/issues/53

@pd4d10 I'm trying to create a contributor screen within a repository. (So far, I've only managed to get the count of contributors and displayed it on the GhRepoScreen). I can do this only through REST and not GraphQL. What do you think is a better option?

  1. Make the API call in the GhUsersScreen or the GhCommitsScreen and use an if condition to decide whether to make a graphql(for others)/rest(for contributors) call. These two screens are almost identical to how the Contributor screen would look with the subtitle in these two being replaced by the number of commits.

  2. Create a separate screen GhContributorsScreen.

Also while using ListPayload of list_stateful.dart scaffold, I'm having a bit of trouble using cursor. Should I use pagination and pass the page number each time as the cursor until the json output is null? Is this right? Or is there a better way to do this?

Thanks in advance for your help.

Originally created by @shreyas1599 on GitHub (Apr 10, 2020). Original GitHub issue: https://github.com/pd4d10/git-touch/issues/53 @pd4d10 I'm trying to create a contributor screen within a repository. (So far, I've only managed to get the count of contributors and displayed it on the `GhRepoScreen`). I can do this only through REST and not GraphQL. What do you think is a better option? 1. Make the API call in the `GhUsersScreen` or the `GhCommitsScreen` and use an `if` condition to decide whether to make a graphql(for others)/rest(for contributors) call. These two screens are almost identical to how the Contributor screen would look with the subtitle in these two being replaced by the number of commits. 2. Create a separate screen `GhContributorsScreen`. Also while using `ListPayload` of `list_stateful.dart` scaffold, I'm having a bit of trouble using `cursor`. Should I use pagination and pass the page number each time as the cursor until the json output is null? Is this right? Or is there a better way to do this? Thanks in advance for your help.
Author
Owner

@pd4d10 commented on GitHub (Apr 11, 2020):

contributor screen within a repository

Do you mean something like this? https://github.com/git-touch/git-touch/graphs/contributors

If so, perhaps it is simpler to create a separate screen?

Also while using ListPayload of list_stateful.dart scaffold, I'm having a bit of trouble using cursor. Should I use pagination and pass the page number each time as the cursor until the json output is null?

Yeah, it's right. The cursor name comes from GraphQL pagination, in which case it is a string. It is designed to be a generic type so could also be used in RESTful API, in which case it is a number

Example here: https://github.com/git-touch/git-touch/blob/master/lib/screens/gh_org_repos.dart

<!-- gh-comment-id:612325713 --> @pd4d10 commented on GitHub (Apr 11, 2020): > contributor screen within a repository Do you mean something like this? https://github.com/git-touch/git-touch/graphs/contributors If so, perhaps it is simpler to create a separate screen? > Also while using ListPayload of list_stateful.dart scaffold, I'm having a bit of trouble using cursor. Should I use pagination and pass the page number each time as the cursor until the json output is null? Yeah, it's right. The `cursor` name comes from GraphQL pagination, in which case it is a `string`. It is designed to be a generic type so could also be used in RESTful API, in which case it is a `number` Example here: https://github.com/git-touch/git-touch/blob/master/lib/screens/gh_org_repos.dart
Author
Owner

@shreyas1599 commented on GitHub (Apr 11, 2020):

Alright, thanks a lot!

<!-- gh-comment-id:612326976 --> @shreyas1599 commented on GitHub (Apr 11, 2020): Alright, thanks a lot!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/git-touch#1572