Flutter dart GRPC client - null safety

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.

Sorry, maybe I don’t understand . How to get Server Sent Events with HTTP APIs from dart ? do you propose to make polling ?

These options have not changed

port ServerEventsClient class to Dart. ?
sorry we are not specialists. Our specialization is in Call communications servers

ASP.Net Core supports gRPC-Web without the Envoy. server streaming. Why this is not applicable in our case ?

  • Support gRPC-Web alongside gRPC HTTP/2 in ASP.NET Core. This option uses middleware provided by the Grpc.AspNetCore.Web package.

@mythz please can you explain us what do you mean with that? how to do it in dart ?

if you’re not already using envoyproxy 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

try to use the external ServerEventsClient JS Lib

I’ve already explained what that passage meant:

I know that probably we ask a lot, but I would much appreciate an example calling from Dart with javascript interop the ServerEventsClient, a long connection and how to return the events.
All of these in Dart are new for us and it is a very small part of our system, but very important.

That’s outside the scope of our support (that we neither have the spare capacity for). Quick search on Google on how to call a JS library from Dart led to this Reddit thread:

Which says to use the js library to call JS APIs from Dart https://pub.dev/packages/js

There’s also special mention of using js_facade_gen to convert TypeScript definition files to Dart which may help bootstrap. The .d.ts for the @servicestack/client TypeScript library is available index.d.ts.