client icon indicating copy to clipboard operation
client copied to clipboard

Flutter web support

Open jaumard opened this issue 4 years ago • 2 comments

I'm trying to port my app to support web, but I'm getting this compilation error:

Dart2Js finished with:                                                  

packages/http/src/multipart_file.dart:14:8:
Error: Error when reading 'packages/http/src/multipart_file_stub.dart': Error reading 'packages/http/src/multipart_file_stub.dart'  (No such file or
directory)
import 'multipart_file_stub.dart'
       ^
packages/http/src/multipart_file.dart:93:7:
Error: Method not found: 'multipartFileFromPath'.
      multipartFileFromPath(field, filePath,
      ^^^^^^^^^^^^^^^^^^^^^
Error: Compilation failed.

I guess Jaguar is doing something (importing or using some http stuff) that are not available for the web platform.

@tejainece any idea ?

jaumard avatar Aug 31 '19 09:08 jaumard

One lead would be to not use the http package and instead use the native HttpClient https://api.flutter.dev/flutter/dart-io/HttpClient-class.html

jaumard avatar Sep 06 '19 20:09 jaumard

Apparently http package is compatible web, but not for multipart requests (and will probably don't be for those) so another solution is to put an abstraction for multipart request and do nothing on web.

jaumard avatar Sep 13 '19 06:09 jaumard