listUserRepositories method

Stream<Repository> listUserRepositories(
  1. String user, {
  2. String type = 'owner',
  3. String sort = 'full_name',
  4. String direction = 'asc',
})

Lists the repositories of the user specified by user in a streamed fashion.

API docs: https://developer.github.com/v3/repos/#list-repositories-for-a-user

Implementation

Stream<Repository> listUserRepositories(String user,
    {String type = 'owner',
    String sort = 'full_name',
    String direction = 'asc'}) {
  ArgumentError.checkNotNull(user);
  final params = <String, dynamic>{
    'type': type,
    'sort': sort,
    'direction': direction
  };

  return PaginationHelper(github).objects<Map<String, dynamic>, Repository>(
    'GET',
    '/users/$user/repos',
    (i) => Repository.fromJson(i),
    params: params,
  );
}