Flutter-Buddies / App

An app with community features like 'calendar of events' and a showcase of member created widgets
16 stars 18 forks source link

GitHub API Integration #8

Open Zambrella opened 3 years ago

Zambrella commented 3 years ago

https://docs.github.com/en/free-pro-team@latest/rest/reference/repos

joeyda3rd commented 3 years ago

https://pub.dev/packages/github

joeyda3rd commented 3 years ago

I have the org repos being pulled into a list of 'repo' objects. It can be passed in a stream or future, whatever we want.

slovnicki commented 3 years ago

@joeyda3rd Cool. Check out the project.dart and project_repository.dart for relevant information about where and how should those repos come.

It's a little tricky naming now due to github "repository" name, but that corresponds to "project"

slovnicki commented 3 years ago

If that github package is being used and it returns some internal object and not JSON, some modifications will be needed, like adding a new constructor to Project, as we now only have .fromJson

joeyda3rd commented 3 years ago

Ya, it's being used and it does return an object but it literally took me 5 minutes. I can just as easily return a JSON. In fact, here's the response. https://api.github.com/orgs/Flutter-Buddies/repos

slovnicki commented 3 years ago

that's nice. Are you working on this or can I just plug that in now?

joeyda3rd commented 3 years ago

Go ahead and plug it in since you've got it set up. There's a little bit of scrubbing to do to "name" to remove dashes. I was just going to use String.replaceAll(). Description is fine as is. Not sure what to do about getting an image. Create an image file in the repo with a standard name? For the ongoing tag, maybe we can use either the 'archived' or 'disabled', boolean?

slovnicki commented 3 years ago

Ok. I'll now just plug it in with basic data and then you and @Zambrella can play around with which else data we want to show in app, as there is really a lot of cool data. Then you'll be just improving on Project attributes and ProjectCard attributes.

slovnicki commented 3 years ago

Ok, now it's using real API. I left the image to be random and didn't format name. You can do that. I'm gonna step off this issue now for a while, at least implementation-wise.

joeyda3rd commented 3 years ago

Need to catch null response fields.