{"id":21186371,"url":"https://github.com/modulovalue/tonejs_meets_flutterweb","last_synced_at":"2025-07-10T01:31:12.660Z","repository":{"id":38134130,"uuid":"217887157","full_name":"modulovalue/tonejs_meets_flutterweb","owner":"modulovalue","description":"Tone.js meets Flutter Web (A simple piano demo)","archived":false,"fork":false,"pushed_at":"2019-10-28T17:58:11.000Z","size":2226,"stargazers_count":43,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-03-03T05:51:27.830Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://modulovalue.com/tonejs_meets_flutterweb/","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/modulovalue.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-10-27T16:58:25.000Z","updated_at":"2022-08-08T01:17:03.000Z","dependencies_parsed_at":"2022-09-17T20:02:37.743Z","dependency_job_id":null,"html_url":"https://github.com/modulovalue/tonejs_meets_flutterweb","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/modulovalue%2Ftonejs_meets_flutterweb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/modulovalue%2Ftonejs_meets_flutterweb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/modulovalue%2Ftonejs_meets_flutterweb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/modulovalue%2Ftonejs_meets_flutterweb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/modulovalue","download_url":"https://codeload.github.com/modulovalue/tonejs_meets_flutterweb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225608179,"owners_count":17495878,"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":[],"created_at":"2024-11-20T18:23:25.312Z","updated_at":"2024-11-20T18:23:26.189Z","avatar_url":"https://github.com/modulovalue.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tone.js meets Flutter Web (A simple piano demo)\r\n[![License](https://img.shields.io/github/license/modulovalue/tonejs_meets_flutterweb?style=flat-square\u0026logo=github)](https://github.com/modulovalue/tonejs_meets_flutterweb/blob/master/LICENSE) [![Github Stars](https://img.shields.io/github/stars/modulovalue/tonejs_meets_flutterweb?style=flat-square\u0026logo=github)](https://github.com/modulovalue/tonejs_meets_flutterweb) [![Twitter Follow](https://img.shields.io/twitter/follow/modulovalue?style=social\u0026logo=twitter)](https://twitter.com/modulovalue) [![GitHub Follow](https://img.shields.io/github/followers/modulovalue?style=social\u0026logo=github)](https://github.com/modulovalue)\r\n\r\nA quick and dirty demo on how to use a JavaScript library with Flutter Web\r\n\r\n[tonejs_meets_flutterweb](https://modulovalue.com/tonejs_meets_flutterweb) (Please use Google Chrome)\r\n\r\n![Screenshot](assets/screenshot1.jpg)\r\n\r\n\r\n## How to use JavaScript in your Flutter Web App. (It's really easy)\r\n1. Add the JavaScript to your [web/index.html](https://github.com/modulovalue/tonejs_meets_flutterweb/blob/13fc08e1eb3d0c7fc7dc4bbe836d787a07ae0269/web/index.html#L15)\r\n\r\n(In this case tone.js)\r\n```html\r\n...\r\n\u003cbody\u003e\r\n  \u003cscript src=\"https://cdnjs.cloudflare.com/ajax/libs/tone/14.4.9/Tone.js\" type=\"application/javascript\"\u003e\u003c/script\u003e\r\n  \u003cscript src=\"main.dart.js\" type=\"application/javascript\"\u003e\u003c/script\u003e\r\n  \u003cscript\u003e\r\n    function playNote(note, duration) {\r\n      var synth = new Tone.Synth().toDestination();\r\n      synth.triggerAttackRelease(note, duration);\r\n    }\r\n  \u003c/script\u003e\r\n\u003c/body\u003e\r\n...\r\n```\r\n\r\n2. Call your JavaScript in Dart\r\n\r\n```dart\r\nimport 'dart:js' as js;\r\n...\r\njs.context.callMethod(\"playNote\", [\"C5\", \"8n\"])\r\n```\r\n\r\nEasy!\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmodulovalue%2Ftonejs_meets_flutterweb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmodulovalue%2Ftonejs_meets_flutterweb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmodulovalue%2Ftonejs_meets_flutterweb/lists"}