-
Notifications
You must be signed in to change notification settings - Fork 1
Support for download via byte stream #20
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
base: main
Are you sure you want to change the base?
Changes from all commits
784bf00
e530b36
6b96fe7
ef2dbd4
c2b7f3d
59821ed
5cf4965
3bcb733
29373b7
4b6a5e1
fba9f3e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| { | ||
| "flutterSdkVersion": "3.3.9", | ||
| "flutterSdkVersion": "3.7.0", | ||
| "flavors": {} | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,90 @@ | ||
| import 'dart:convert'; | ||
| import 'dart:typed_data'; | ||
|
|
||
| import 'package:http/http.dart'; | ||
|
|
||
| enum RequestMode { | ||
| sameOrigin('same-origin'), | ||
| noCors('no-cors'), | ||
| cors('cors'), | ||
| navigate('navigate'), | ||
| webSocket('websocket'); | ||
|
|
||
| const RequestMode(this.mode); | ||
|
|
||
| factory RequestMode.from(String mode) => | ||
| values.firstWhere((element) => element.mode == mode); | ||
|
|
||
| final String mode; | ||
|
|
||
| @override | ||
| String toString() => mode; | ||
| } | ||
|
|
||
| class FetchResponse extends StreamedResponse { | ||
| FetchResponse(super.stream, super.statusCode, this.cancel, this.url, this.redirected); | ||
|
|
||
| final void Function() cancel; | ||
|
|
||
| final String url; | ||
|
|
||
| final bool redirected; | ||
| } | ||
|
|
||
| class FetchClient implements BaseClient { | ||
| FetchClient({ | ||
| RequestMode? mode, | ||
| }) { | ||
| throw UnimplementedError(); | ||
| } | ||
|
|
||
| @override | ||
| Future<FetchResponse> send(BaseRequest request) { | ||
| throw UnimplementedError(); | ||
| } | ||
|
|
||
| @override | ||
| void close() { | ||
| throw UnimplementedError(); | ||
| } | ||
|
|
||
| @override | ||
| Future<Response> delete(Uri url, {Map<String, String>? headers, Object? body, Encoding? encoding}) { | ||
| throw UnimplementedError(); | ||
| } | ||
|
|
||
| @override | ||
| Future<Response> get(Uri url, {Map<String, String>? headers}) { | ||
| throw UnimplementedError(); | ||
| } | ||
|
|
||
| @override | ||
| Future<Response> head(Uri url, {Map<String, String>? headers}) { | ||
| throw UnimplementedError(); | ||
| } | ||
|
|
||
| @override | ||
| Future<Response> patch(Uri url, {Map<String, String>? headers, Object? body, Encoding? encoding}) { | ||
| throw UnimplementedError(); | ||
| } | ||
|
|
||
| @override | ||
| Future<Response> post(Uri url, {Map<String, String>? headers, Object? body, Encoding? encoding}) { | ||
| throw UnimplementedError(); | ||
| } | ||
|
|
||
| @override | ||
| Future<Response> put(Uri url, {Map<String, String>? headers, Object? body, Encoding? encoding}) { | ||
| throw UnimplementedError(); | ||
| } | ||
|
|
||
| @override | ||
| Future<String> read(Uri url, {Map<String, String>? headers}) { | ||
| throw UnimplementedError(); | ||
| } | ||
|
|
||
| @override | ||
| Future<Uint8List> readBytes(Uri url, {Map<String, String>? headers}) { | ||
| throw UnimplementedError(); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,7 +5,7 @@ publish_to: none | |
|
|
||
| environment: | ||
| sdk: '>=2.18.5 <3.0.0' | ||
| flutter: 3.3.9 | ||
| flutter: 3.7.0 | ||
elliotsayes marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TODO for @matibat: check what are the downsides of bumping the version for localizations
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just FYR already fixed a bunch of localisation errors in the ArDrive-web PR |
||
|
|
||
| script_runner: | ||
| shell: | ||
|
|
@@ -21,11 +21,14 @@ script_runner: | |
| - test: scr test-vm && scr test-web | ||
|
|
||
| dependencies: | ||
| cancellation_token_http: ^1.2.0 | ||
| dio: ^5.0.0 | ||
| dio_smart_retry: ^5.0.0 | ||
| equatable: ^2.0.5 | ||
| fetch_client: ^1.0.0 | ||
| flutter: | ||
| sdk: flutter | ||
| http: ^0.13.5 | ||
| isolated_worker: ^0.1.1 | ||
| shelf: ^1.4.0 | ||
| shelf_router: ^1.1.3 | ||
|
|
@@ -34,3 +37,4 @@ dev_dependencies: | |
| flutter_test: | ||
| sdk: flutter | ||
| flutter_lints: ^2.0.1 | ||
| async: ^2.9.0 | ||
Uh oh!
There was an error while loading. Please reload this page.