{"id":21383080,"url":"https://github.com/namiwang/actioncable_dart","last_synced_at":"2025-04-13T06:41:36.307Z","repository":{"id":36290791,"uuid":"162677630","full_name":"namiwang/actioncable_dart","owner":"namiwang","description":"actioncable client in dart, for pure dart or flutter project","archived":false,"fork":false,"pushed_at":"2024-10-25T14:47:41.000Z","size":5433,"stargazers_count":27,"open_issues_count":10,"forks_count":26,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-06T06:37:29.877Z","etag":null,"topics":["actioncable","dart","flutter","websocket"],"latest_commit_sha":null,"homepage":null,"language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/namiwang.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-12-21T06:53:13.000Z","updated_at":"2025-02-20T00:52:39.000Z","dependencies_parsed_at":"2025-01-17T09:06:47.008Z","dependency_job_id":"30b2c691-0051-4c64-bb30-6d06e54fddda","html_url":"https://github.com/namiwang/actioncable_dart","commit_stats":{"total_commits":38,"total_committers":6,"mean_commits":6.333333333333333,"dds":0.4736842105263158,"last_synced_commit":"7dfd5f1888a5dcc682296474d052f27f7cd3a353"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/namiwang%2Factioncable_dart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/namiwang%2Factioncable_dart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/namiwang%2Factioncable_dart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/namiwang%2Factioncable_dart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/namiwang","download_url":"https://codeload.github.com/namiwang/actioncable_dart/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248675434,"owners_count":21143763,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["actioncable","dart","flutter","websocket"],"created_at":"2024-11-22T11:19:42.857Z","updated_at":"2025-04-13T06:41:36.279Z","avatar_url":"https://github.com/namiwang.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Pub](https://img.shields.io/pub/v/action_cable)\n\n\u003c!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --\u003e\n\n[![All Contributors](https://img.shields.io/badge/all_contributors-3-orange.svg?style=flat-square)](#contributors-)\n\n\u003c!-- ALL-CONTRIBUTORS-BADGE:END --\u003e\n\n# ActionCable in Dart\n\nActionCable is the default realtime websocket framework and protocol in Rails.\n\nThis is a dart port of the client and protocol implementation which is available in web, dartVM and flutter.\n\n## Usage\n\n### Connecting to a channel 🙌\n\n```dart\ncable = ActionCable.connect(\n  \"ws://10.0.2.2:3000/cable\",\n  headers: {\n    \"Authorization\": \"Some Token\",\n  },\n  onConnected: (){\n    print(\"connected\");\n  },\n  onConnectionLost: () {\n    print(\"connection lost\");\n  },\n  onCannotConnect: () {\n    print(\"cannot connect\");\n});\n```\n\n### Subscribing to channel 🎉\n\n```dart\ncable.subscribe(\n  \"Chat\", // either \"Chat\" and \"ChatChannel\" is fine\n  channelParams: { \"room\": \"private\" },\n  onSubscribed: (){}, // `confirm_subscription` received\n  onDisconnected: (){}, // `disconnect` received\n  onMessage: (Map message) {} // any other message received\n);\n```\n\n### Unsubscribing from a channel 🎃\n\n```dart\ncable.unsubscribe(\n  \"Chat\", // either \"Chat\" and \"ChatChannel\" is fine\n  {\"room\": \"private\"}\n);\n```\n\n### Perform an action on your ActionCable server 🎇\n\nRequires that you have a method defined in your Rails Action Cable channel whose name matches the action property passed in.\n\n```dart\ncable.performAction(\n  \"Chat\",\n  action: \"send_message\",\n  channelParams: { \"room\": \"private\" },\n  actionParams: { \"message\": \"Hello private peeps! 😜\" }\n);\n```\n\n### Disconnect from the ActionCable server\n\n```dart\ncable.disconnect();\n```\n\n## ActionCable protocol\n\nAnycable has [a great doc](https://docs.anycable.io/#/misc/action_cable_protocol) on that topic.\n\n## Contributors ✨\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://clintonmbah.com\"\u003e\u003cimg src=\"https://avatars1.githubusercontent.com/u/18232142?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eClinton\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/namiwang/actioncable_dart/commits?author=mclintprojects\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/namiwang/actioncable_dart/commits?author=mclintprojects\" title=\"Tests\"\u003e⚠️\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"http://www.hamadalghanim.com\"\u003e\u003cimg src=\"https://avatars0.githubusercontent.com/u/6298868?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eHamad AlGhanim\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/namiwang/actioncable_dart/commits?author=Dreamersoul\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"http://fareesh.itsalive.in\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/498161?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eFareesh Vijayarangam\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/namiwang/actioncable_dart/commits?author=fareesh\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnamiwang%2Factioncable_dart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnamiwang%2Factioncable_dart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnamiwang%2Factioncable_dart/lists"}