-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1e11304
commit 15a8a3a
Showing
7 changed files
with
32 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
platforms: | ||
- vm | ||
- chrome | ||
compilers: | ||
- dart2js | ||
- dart2wasm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,9 @@ | ||
import 'package:tekartik_app_http/app_http.dart'; | ||
import 'package:tekartik_common_utils/env_utils.dart'; | ||
import 'package:tekartik_http/http.dart'; | ||
|
||
HttpClientFactory? _httpClientFactoryUniversal; | ||
import 'platform/platform.dart' show httpClientFactoryUniversal; | ||
|
||
/// The convenient client factory | ||
HttpClientFactory get httpClientFactoryUniversal => | ||
_httpClientFactoryUniversal ??= () { | ||
if (isRunningAsJavascript) { | ||
return httpClientFactoryBrowser; | ||
} else { | ||
return httpClientFactoryIo; | ||
} | ||
}(); | ||
export 'platform/platform.dart' show httpClientFactoryUniversal; | ||
|
||
// Compat | ||
// Compat, prefer using httpClientFactoryUniversal | ||
// @Deprecated('Use httpClientFactoryUniversal') | ||
HttpClientFactory get httpClientFactory => httpClientFactoryUniversal; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export 'platform_none.dart' | ||
if (dart.library.io) 'platform_io.dart' | ||
if (dart.library.js_interop) 'platform_web.dart'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import 'package:tekartik_http/http.dart'; | ||
import 'package:tekartik_http_io/http_client_io.dart'; | ||
|
||
HttpClientFactory get httpClientFactoryUniversal => httpClientFactoryIo; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import 'package:tekartik_http/http.dart'; | ||
|
||
HttpClientFactory get httpClientFactoryUniversal => | ||
throw UnsupportedError('HttpClientFactoryUniversal.none'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import 'package:tekartik_http/http.dart'; | ||
import 'package:tekartik_http_browser/http_client_browser.dart'; | ||
|
||
HttpClientFactory get httpClientFactoryUniversal => httpClientFactoryBrowser; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters