Last active
April 5, 2021 11:09
-
-
Save Dev-Owl/f1d4f911d0a1d4bc5599d095a25fae7d to your computer and use it in GitHub Desktop.
Platform code, ahead of time
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
import 'package:http/http.dart' as http; | |
http.Client getClient() { | |
throw UnimplementedError('Unsupported'); | |
} |
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
import 'package:http/http.dart' as http; | |
http.Client getClient() { | |
return http.Client(); | |
} |
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
import 'package:http/browser_client.dart'; | |
import 'package:http/http.dart' as http; | |
http.Client getClient() { | |
final client = http.Client(); | |
(client as BrowserClient).withCredentials = true; | |
return client; | |
} |
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
import 'pillowHttp/pillowHttp_stub.dart' | |
if (dart.library.io) 'pillowHttp/pillowHttp_app.dart' | |
if (dart.library.html) 'pillowHttp/pillowHttp_web.dart'; | |
//Further code ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment