Skip to content

Make method createGitHubClient support vm flutter and web. #183

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions lib/github.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/// The code come from https://github.com/dart-lang/http/blob/9a17157e6a71972f929a95c6b2b36992e5e02c6d/lib/src/client.dart#L11-L16

// ignore: uri_does_not_exist
// ignore:
export 'github_stub.dart'
// ignore: uri_does_not_exist
if (dart.library.html) 'browser.dart'
// ignore: uri_does_not_exist
if (dart.library.io) 'server.dart';

export 'src/common.dart';
6 changes: 6 additions & 0 deletions lib/github_stub.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import 'src/common.dart';

GitHub createGitHubClient(
{Authentication auth, String endpoint = "https://api.github.com"}) =>
throw UnsupportedError(
'Cannot create a client without dart:html or dart:io.');