fromGithub static method

Github fromGithub(
  1. String url,
  2. String accessToken, {
  3. CodeFilter? codeFilter,
  4. IssueFilter? issueFilter,
  5. List<GithubExtract> extractOnly = const [GithubExtract.code],
})

static method to create and return Github. It takes a GitHub repository url as input and optionally accepts CodeFilter, IssueFilter, and GithubExtract objects.

Example:

final githubUrl = 'https://github.com/flutter/flutter';

final accessToken = 'your personal github access token'

// filter out dart files
final codeFilter = CodeFilter(pathRegex: '.*\.dart');

// filter out issues with label "bug"
final issueFilter = IssueFilter(labels: ['bug']);

// specificy what objects need to be extracted - code, issue, both
final extractObject = GithubExtract.code

final githubObject = WebDataObject.fromGithub(githubUrl, accessToken,
    codeFilter: codeFilter, issueFilter: issueFilter, extractOnly: extractObject);

Implementation

static Github fromGithub(String url, String accessToken,
    {CodeFilter? codeFilter,
    IssueFilter? issueFilter,
    List<GithubExtract> extractOnly = const [GithubExtract.code]}) {
  return Github(
      url: url,
      accessToken: accessToken,
      codeFilter: codeFilter,
      issueFilter: issueFilter,
      extractOnly: extractOnly);
}