Skip to content

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

@yehudamakarov

Description

@yehudamakarov

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions