Graphql-flutter: Flutter For Web - Make Sure `graphql_flutter` works with flutter for Web

Created on 24 Sep 2019  路  11Comments  路  Source: zino-app/graphql-flutter

Because of this error:

[ +990 ms] Skipping compiling doc|lib/main_web_entrypoint.dart with ddc because some of its
                    transitive libraries have sdk dependencies that not supported on this platform:

                    path_provider|lib/path_provider.dart
                    platform|lib/src/interface/local_platform.dart

                    https://github.com/dart-lang/build/blob/master/docs/faq.md#how-can-i-resolve-skipped-compiling-warnings

However, the dart only package seems to work in Flutter for Web

cache enhancement flutter_for_web help wanted

Most helpful comment

The good news is that InMemory cache is fully supported by flutter for web, I will PR some changes to make this seamless, we just need to make WebSockets compatible and we are headed somewhere.

All 11 comments

I will look into this next week. I am going to repurpose this issue so that we can use it to make sure flutter for the web works as expected.

Support for flutter for web turns out is a little bit more complex. We currently don't have a way of switching between native APIs such as IO and browsers API such local storage, this makes it a little bit tricky to build one app that can be deployed to both native and web. We currently have some web APIs for web sockets and I believe in-memory cache but those I will have to test and we can make improvements if any are needed.

It's still early for flutter for web, and with time, full support by this package should be possible.

Yes, a little bit tricky. I have a prototype working using your GraphQL package on both web and native. I had to use conditional imports for different implementations, such as MultipartFile. Then it seems working fine, even for the file uploads.

@mainawycliffe @guiguan Additionally I am looking for encrypted offline support. So was looking to make https://pub.dev/packages/sembast custom cache in between. How much work you guys think it is, if were to be done properly?

@jascodes could you please open a new issue for this, it's better not to hijack another issue whose purpose is different.

@guiguan conditional imports are probably the best way to go, for now.

The good news is that InMemory cache is fully supported by flutter for web, I will PR some changes to make this seamless, we just need to make WebSockets compatible and we are headed somewhere.

So right now this package still cannot be used for flutter for web? When are you guys expecting to make it partially compatible? Thanks for your hard work!

@brianschardt still working on it, there are some features we are currently waiting to hit the Flutter stable version for it to work effectively and then the #446 can be merged without breaking anything. If you are on the master or beta channel, you can help to test the PR and provided feedback through this issue.

closed by #590 and released in 3.1.0-beta.1

@micimize Just commenting here instead of opening another issue.
On pub.dev I still don't see web listed on platforms.

image

Was this page helpful?
0 / 5 - 0 ratings