@asyncapi/template-dart-websocket-client v0.0.1
Dart WebSocket Client
You can test this template:
1. Clone the project and run npm install
2. Navigate to packages/templates/clients/websocket/dart
3. Install with npm install
and run test with npm run test
4. Navigate to the generated Hoppscotch client folder with cd test/temp/snapshotTestResult/custom_client_hoppscotch
5. Install dependencies of the generated client: dart pub get
6. Start an example script that uses a client library generated by the test: dart run --packages=.dart_tool/package_config.json ../../../../example.dart
By default, this is testing against Hoppscotch Echo service. You can modify
packages/templates/clients/websocket/dart/example.dart
and change first line toimport 'test/temp/snapshotTestResult/client_postman/client.dart';
and line 15final wsClient = PostmanEchoWebSocketClientClient();
and rundart run --packages=.dart_tool/package_config.json ../../../../example.dart
again. You will see the example still works but against a different API. This is possible as both AsyncAPI documents have the same name of operation for sending messages:sendEchoMessage
so each client generated has the same API.
5 months ago