Jaguar-dart / client

Contains various packages for client side

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Flutter web support

jaumard opened this issue · 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 ?

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

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.