Flutter dart GRPC client - null safety

@mythz we have another problem now. The request was served by the service but it returns this error
image (24)

Can you help please?

It’s as it says, gRPC Web isn’t supported.

what do you mean?
we can’t use the gRPC from flutter - web? streamserverEvents ?

gRPC Web isn’t natively supported as web clients are not able to communicate directly with gRPC endpoints, it required an Envoy Proxy to forward the gRPC Web Requests to native gRPC endpoints.

We had read it. But you wrote

we instead recommended using ServiceStack HTTP JSON Services, made possible since ServiceStack’s gRPC Service implementations are also made available over REST-ful HTTP APIs

How we should do it? an example?

That just says to use normal HTTP/Service Clients to call the ServiceStack APIs over HTTP/JSON as-is standard for API Requests from browsers.

We want streamserverEvents with gRPC How to suceed it ? only with anEnvoy Proxy ? an example of that? or we should search the internet?

For Websites you would need to go through a gRPC Web Proxy like Envoy Proxy, though I’ve never tried using it myself, essentially all Websites are going to call HTTP APIs instead.

So for Flutter- web we don’t have have a working example if it works for StreamServerEvents? correct?
https://docs.servicestack.net/server-events-grpc#streamserverevents
we should try and see if it works?

@mythz

essentially all Websites are going to call HTTP APIs instead.

How to get server events in dart ?

You can’t using Dart on Web, if you can call out to JS you may be able to use the JS ServerEventsClient and marshal the responses back into your App. Although I don’t know how good Flutter Web’s support is for interoperating with JS libs, dart2js use to have decent support for it.

So we don’t know for sure if StreamServerEvents works for flutter - web

No, since it’s not supported. Only potential solutions I see would try setup gRPC Web, try to use the external ServerEventsClient JS Lib or port ServerEventsClient class to Dart.

Sorry, I don’t understand you. I had asked before a month for the server events in flutter web and followed your advice to use the gRPC. I’m trying to find my question (btw how I can filter only my questions in forum).
this answer of yours (maybe I did not understand it well?)

That’s for normal iOS/Android Flutter not Web where these are the only options I see:

my question was for flutter web (I had written that) and layoric had tried to answer on that with an example.
I would much appreciate a working example of how to setup gRPC Web or any other way to have server events in Dart - flutter web

I would much appreciate some advice and directions on the preferable ServiceStack technologies, in the following architecture.
Client = Flutter on web (page will be hosted in the ServiceStack API)

Nothing is going to change the fact that gRPC Web is not supported from Web as per the docs you’ve already read. The linked gRPC Docs for configuring Envoy are hosted at https://grpc.io/docs/tutorials/basic/web/#configure-the-envoy-proxy

Understood that. I would expect only from your side to have a working example of streamServerEvents with Envoy, only to avoid other surprises.

We’re not investing the effort because relatively no-one is going to go through the complexity of hosting a gRPC Web Proxy when nearly everyone would call HTTP APIs instead as per our recommendation in the docs.