grpc_web_flutter_example icon indicating copy to clipboard operation
grpc_web_flutter_example copied to clipboard

How to use grpc for mobile and grpc-web for browser

Open yehudamakarov opened this issue 3 years ago • 0 comments
trafficstars

I saw your comment here about using grpc in flutter.

My goal is to have one codebase, deploy it to mobile and browser, and still use grpc. Since grpc-web is the only option for the browser, I'm wondering if I can use both.

I understood this is what you meant by

That means to have a program working in both mobile and web you need to do a conditional import in a file for obtaining a GrpcChannel object.

When you say conditional import, do you mean: what is mentioned in this post?

And would that mean this code in your example would need to be adjusted?

I'm new to flutter and dart and trying to see if this is possible before beginning a project.

yehudamakarov avatar Jan 09 '22 17:01 yehudamakarov