Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Dart/Flutter Support? #1357

Open
2 tasks done
JohnGalt1717 opened this issue Feb 5, 2025 · 7 comments
Open
2 tasks done

[FEATURE] Dart/Flutter Support? #1357

JohnGalt1717 opened this issue Feb 5, 2025 · 7 comments
Labels
enhancement New feature or request

Comments

@JohnGalt1717
Copy link

Why do we need this improvement?

Dart/Flutter now has a HUGE following and is 25% of all apps in the app stores. It would be highly beneficial if we could automatically generate clients and models for Dart using the Generator.

How will this change help?

By being able to generate Dart clients from AsyncApi it will eliminate a ton of boilerplate code that often breaks right now in Dart and we can couple to our servers

Screenshots

No response

How could it be implemented/designed?

Just a generator that generates all of the models (the page I found for dart thinks it's go... https://modelina.org/examples?selectedExample=generate-dart-models) and should generate clients automatically as well.

🚧 Breaking changes

No

👀 Have you checked for similar open issues?

  • I checked and didn't find a similar issue

🏢 Have you read the Contributing Guidelines?

Are you willing to work on this issue?

No, someone else can work on it.

@JohnGalt1717 JohnGalt1717 added the enhancement New feature or request label Feb 5, 2025
Copy link
Contributor

github-actions bot commented Feb 5, 2025

Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our contributors guide and the instructions about a basic recommended setup useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

@derberg
Copy link
Member

derberg commented Feb 5, 2025

@JohnGalt1717 hey and thanks for the suggestion. Some followups:

  • you are referring to some specific protocol, I guess for mobile it would be websocket?
  • if you are not interested in contributing, can you at least share examples of such client code?
  • would you be able to at least join reviews and do manual tests of the clients?
  • best if you can also share some example AsyncAPI documents that would be used for such client - can be anonymized

btw, for models, you do not need generator. We can of course include models generation in such client template, but for models only you can already use https://github.com/asyncapi/cli and command like asyncapi generate models dart ./asyncapi.yml

@JohnGalt1717
Copy link
Author

Yes, I was thinking 2 different types of clients:

https://pub.dev/packages/web_socket
https://pub.dev/packages/signalr_netcore

And then model generation.

The idea here being that raw web_sockets if that's what you're using and then signalR for those using it.

Copy link
Member

derberg commented Feb 5, 2025

I see https://pub.dev/packages/web_socket_channel is more popular

although future goal of code gen here is to be super modular and support clients for one protocol and one language with different libraries/frameworks

@JohnGalt1717
Copy link
Author

Not picky about which client, really as long as it's maintained. Last time I looked that one was separated into 3 modules for web, ios and android and no others. Looks like it's unified now so cool.

@shwetd19
Copy link

shwetd19 commented Feb 8, 2025

@JohnGalt1717 @derberg

I'd suggest we start with basic WebSocket client generation targeting web_socket_channel, include model generation integration with the AsyncAPI CLI, focus on a modular design that could later support different protocols/frameworks, and add proper error handling and reconnection logic out of the box.

@JohnGalt1717
Copy link
Author

That works for me. SignalR just delimits its messages across the wire with a special character so there isn't a large lift.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants