final search = SearchService(GitHub()); final fixedQuery = 'repo%3Aflutter/flutter+is%3Aopen+is%3Aissue+label%3A"a%3A+annoyance"'; final issueStream = search.issues(fixedQuery); int length = await issueStream.length; print(length);
q=prefix? Or should it be encoded differently?
'repo:flutter/flutter+is:open+is:issue+label:"a: annoyance"',, the encoded query is
encodeFull()instead ensures the right query is passed to GitHub, but I'm not sure if that's what you really want
I mean the later, using the GitHub.dart library to check out a different project which is private and is where I have the contents of my app hosted.
You got it. I know with your library I can save the documents. But I was wondering if there was a better way of doing this so I can then "pull the changes" into the local branch without having to download all the files again... FYI I want to do it this way because that way I can access the commit messages and revision history of each document.
Im sorry I didn't get to see your reply earlier, thank you so much for your fast reply.
You have an interesting use case. It sounds like you want to have a Dart API to interact with a locally cloned repo .. which this library isn’t meant to do. It’s basically just a Dart strongly typed API to the GitHub v3 network API. But, all is not lost. Since I’m not exactly sure if the number of files would be changing in your repo that you would want to be synced or if you just want to be able to update files and get the new version and the message for the update, I’ll give a few thoughts. For your use case, I would recommend either:
hard way: figure out a way to ship a git client binary (for android and IOS) and then call by spawning a process to clone/pull the repo. Then you could use the git log to see what was updated.
Easier way: Basically, implement a cheap “clone” functionality yourself. You’ll be keeping track of which commit you have downloaded. Use this library to list all commits in the repo (or if there are newer than the one you already have). For each commit, get a list of file and their locations, then request each files at this commit and save it to the filesystem at the correct path.
This will not be as efficient as a real git clone since it only downloads the diffs needed, this would download the full file at each commit. But if you just want the latest all the time and the things that have changed .. you could simplify and list files in the repo and download them all, then list commits to get the list of things that have changed. @lucianolang
listPublicEventsPerformedByUserreturns a stream of events of one user, the only thing I can think of is to first get a list of users, combine a list of public event streams for each user, and listen to that combined stream. But that seems crazy to me.